r/visualbasic • • Feb 26 '22

VB6 Help I just figured out how to press some buttons on Visual Basic. it kinda involves some item.property type format in the code to type.

9 Upvotes

Well, if you press a button, and say something such as...

Label1.caption = Text1.text

well, it worked!

now I know how to do a few simple functions on VB.

Isn't it weird how a simple step like this felt like an anxiety attack trying to figure it out? I found out this simple step from a YouTube video.

I just thought I'd also make this statement so that beginners will have an idea on what to do.


r/visualbasic • • Feb 03 '22

Hey, I need to make a savings account for my Visual Basic coding course, basically I need to make deposits add value in total savings and withdraws to subtract value to total savings but I don’t even know how to start, thanks in advance.

Post image
9 Upvotes

r/visualbasic • • Nov 17 '21

C-Prime -- All-Platforms Visual Basic 6 "clone" Launches

9 Upvotes

Today, C-Prime a Visual Basic 6 "clone" is launching. It is an all platforms, easy-to-use Visual Basic 6 "clone" that can compile to machine code on every platform (Windows, Mac, Linux, Android, iPhone).

https://www.indiegogo.com/projects/c-prime-easy-applications-everywhere#/

https://youtu.be/HbvnBzYu2Ho

If you have any ideas on how to form a community or even spread the word about our C-Prime project, please comment because this is brand new, but reddit is great place to communicate new things .


r/visualbasic • • Nov 08 '21

Article What’s New for Visual Basic in Visual Studio 2022

9 Upvotes

r/visualbasic • • Apr 25 '21

Tips & Tricks Visual Studio - Windows Forms Hello World - First of many helpful videos for new developers

Thumbnail
youtube.com
9 Upvotes

r/visualbasic • • Apr 02 '21

VB.NET Help Noob question. How do I keep the toolbox out without blocking the design area?(VB Studio 2015)

Post image
9 Upvotes

r/visualbasic • • Feb 01 '21

VB.NET Help Can I set a maximum height for a form without setting a maximum width?

9 Upvotes

EDIT: u/thudly offered a viable workaround

This question is for Visual Studio version 16.7.5 with .NET version 4.8.03752

The default maximum height and width for a form is (0,0). This means that the form's height and width can be adjusted without explicit limits. I can programmatically set these values with the following line:

Me.MaximumSize = New Size(0, 0)

If I want to set an explicit maximum size for a form, I can change those values to non-zero.

Me.MaximumSize = New Size(1000, 500)

That will set the maximum width to 1000, and the maximum height to 500. I can do that in my program, then go back to the default behavior (no explicit limits) by changing those values back to (0,0).

But let's say I want to set an explicit limit for the height without setting an explicit limit for the width. I can't figure out how to do that. If I try this:

Me.MaximumSize = New Size(0, 200)

That will set an explicit maximum of 0 for the width and an explicit maximum of 200 for the height. I'm looking for a way to be able to set the max of 200 for the height, but remove the explicit limit for the width.

Can I do that? And if so, how?


r/visualbasic • • Jan 25 '21

VB6 Help Does anyone know why is this an error, because for the others is completely fine

Post image
9 Upvotes

r/visualbasic • • Sep 22 '20

Please help! Code won’t execute when the calculate button is pressed, the text boxes remain blank. What am I doing wrong?

Thumbnail
gallery
9 Upvotes

r/visualbasic • • Aug 13 '20

VBScript I made my first application today. What was the first thing you built?

9 Upvotes

I work in Business Intelligence Analytics. I had been running someone else’s VBA macro to pull some csv files and put them in the right place so my recurring reports are easier to refresh. I successfully migrated it to a VBScript application this week, then wrote out some script for a new application that prompts you for your report links and folder paths, then enters the code into a new report pulling vbs file so other people in my org can easily set it up on their computers.

It was my first coding adventure, and it was a lot of fun!

I’m interested to see what the first thing other people on here built was, if you’re interested in sharing.


r/visualbasic • • Apr 08 '20

VB6 Help VB6.0 Learning Edition

9 Upvotes

With everything going on right now, I have some spare time and wanted to work on a game.

Problem is I cannot seem to get Winsock to work ... I get a license error. I have a legal copy of the Learning Edition I bought years ago.

Any ideas?


r/visualbasic • • Apr 05 '20

VB 2017

9 Upvotes

Okay so, I'm taking visual basic in college and this whole Corona shit hit and the teacher I have decided we could do it online and then provided no help whatsoever. The book we're using doesn't explain anything and it's past due now because I couldn't figure it out on my own. It's super basic but again the teacher taught me nothing and so now all I know is how to code and exit button. Here's what I have to do: the user needs to enter current sales amount and I need a button to calculate 10% increase displayed in lblincrease a button for projected sales amount and display in lblProjected.

I've literally learned Jack squat so far so I'd really appreciate an explanation on how to do it. I've taken Java and c++ so I know the basics.


r/visualbasic • • Nov 06 '19

Visual Basic programmers , what do you actually do at your job?

9 Upvotes

My friend just told me the place where he works at needs some Visual Basic programmers. I haven't used VB much but I like C++/C#, and considered building a small portfolio because VB looks like something I would like to use and be good at.

But what do you actually do as a VB programmer, hired by a company? And do you have any suggestions on what I should do?


r/visualbasic • • May 12 '19

Making games in VB.NET

9 Upvotes

Many of us love the VB.NET. There are many technologies far more popular than our favorite language but looking at the TIOBE ranking, I realize that many of us do not want to change language.

I find it unfortunate that since the demise of DirectX Managed, there are not many people left who are trying the adventure of developing games with VB.NET. After much research on the internet, there are only a few people who persist in the creation of games, without going very far because of the lack of documentation and tools. I am one of those people who thinks that VB.NET has a place in game development.

That's why I'm talking to our community, do you also have this frustration of the non-existence of VB.NET in the video game world?

Do you think that VB.NET has a place with other languages ​​in video games?

Would you like to make games in VB.NET?

If there was a VB.NET game engine, would you use it?

This is an open debate to bring together all VB.NET developers who are interested in creating games and discuss together the limits and possibilities of wearing VB.NET in the video game scene.


r/visualbasic • • Feb 12 '19

An Exhausting List of Differences Between VB.NET & C#

Thumbnail
anthonydgreen.net
9 Upvotes

r/visualbasic • • Dec 08 '14

Useful VB.Net resources thread

9 Upvotes

OK I want to get input on useful resources we can add to the wiki for vb programmers. So

Reading Materials

Pragmatic Programmer

Tool Box

JustCode - Telerik $250 ( I use this one)

Resharper -

CodeRush -

Code Convertors

http://converter.telerik.com/

http://www.developerfusion.com/tools/convert/csharp-to-vb/

Controls

Telerik

Data Access

Telrik Data Access - FREE

Regex

http://refiddle.com/

https://dotnetfiddle.net/

-Edit: Added CalvinR stuff


r/visualbasic • • Feb 14 '14

Tips & Tricks How Classes work. Part 1 - a beginner’s primer on using classes in your projects.

9 Upvotes

In an effort to bring content to the Visual Basic subredit I am going to start posting VB thoughts and learned tidbits from 20 plus years programming in VB. If you have a different opinion on something please let us know. Discussion is healthy and I want this to be fun for everybody.

Back in the day of VB4 (and earlier for that matter) we used to create a module file that maintained all functions that a program would use application wide. This became a nightmare to manage (let alone work out scope of variables) and you would start breaking them up into many modules trying to maintain some sort of organization. When trying to fix a bug 6 Months later you had to remember where a function was and spend a bunch of time tracing your code path with the F8 key (now F10 in VB.net) to remember what you were thinking in your last update the customer needed in 5 minutes.

We had classes in VB4 but they were a nightmare unto themselves and it wasn't until VB5 that they finally got to a point that I started using them regularly. Having said that they were not true OOP (Object Oriented Programming) Classes. It was not until .Net that we received true Classes.

I am going to show you a "file cabinet approach to code" using classes. In a later post I will explain Inheritance. I believe that showing people how classes help organize and manage code makes it easier to understand.

I like to think of classes as a place to store and organize code. In today’s world that is referred to as an Object. A chunk of code that has things and does stuff.

Here is an Example of an empty class

Public Class Car
	'Properties, Methods and Functions go here.
End Class

If you want to create an empty class in vb.net right click you project in the solution explorer and click on ADD > Class. Give it a name that represents what the class is going to be. and hit save. I am going to use "Car" as my example. Why? because I like cars...

NOTE: This a good time to talk about code organization. Create a folder called Classes and put all of your classes in it. Create subfolders if you have many classes, organize your folders by Intent. People bitch at my old school approach and say Namespaces are the way to organize code, but time and time again folder structures have helped me figure out some source control fubar or another. You do use source control don’t you?

Classically (no pun intended) a Class Object consists of Properties, Functions and Methods. It was explained to me using a car metaphor;

A car has options, it can have a colour, engine, and a stereo. These are the Cars Properties. They describe information about the car. Let’s take our code above and a new property called Colour;

Public Class Car

#Region "Properties"

	Private _Colour As String
	Public Property Colour() As String
		Get
			Return _Colour
		End Get
		Set(ByVal value As String)
			_Colour = value
		End Set
	End Property

#End Region

End Class

NOTE: #Region is your friend! use it to organize your code in your classes, I use "properties" and "methods" as my main two regions. You can also break up your code further, but a good rule of thumb is that if you have a class that has so many functions and properties that it is difficult to navigate you probably need another class.

Shortcut Alert: Adding properties in VB.Net is supper fast type "prop" and press the tab twice it will template in a property which you can edit by just clicking the coloured areas and it modifies the whole property to match.

Code Tip: I use _ to indicate a private variable some people use Upper and Lower case but I always found that it was hard to read. If it has an underscore in front of it, it's easier to see what is going on in your code base.

In the code above I have created a space that stores information about a Cars colour. I store it as a string, but you could set the type of the property to another class or object. You could put a control type into the property and pass a whole control into your class if you wish. We will get into that in another post I think.

A property consist of an internal private variable, a Get and A Set. to make a useable copy of this class (Instantiate the class) you need to create a variable for it and set the type to the class name.

Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load

    Dim myCar As New Car
    myCar.Colour = "Blue"

    Dim myCarColour As String = myCar.Colour
    Debug.Print(myCarColour)

End Sub

Now we have a car and that car is blue. The normal notation for this property is myCar.Colour. When you give the property a value you are using the SET portion of the property to assign the value to the internal private variable. When you retrieve the value of a property you are using the GET to retrieve the value from the private internal variable. if you run the program at this point you will get in the debug window

Now some people will tell you that all you need to do is create a public variable in your class and it will be exposed when you instantiate it. While this is true coming from an old timer don’t do this it will come back to haunt you later.

There are two reasons you should always use a get set;

1. You can remove either the get or the set to stop a programmer from either retrieving information about a variable or changing that variable.
2. you can modify the get or set to Validate, or modify the value passed in or out (Don’t do this, more further in)

Let’s look at these two things closer.

A property can be, Read/Write (Get and Set), Read (Get only), or Write (Set only). Most of the time you will want the programmer using your class to be able to do what they need with the property thus Read/Write. In certain cases you will only want them to retrieve the value. You do this with the ReadOnly parameter when creating your property.

Here is the code that we would add in our Properties region to add the property "Running"

Private _Running As Boolean
Public ReadOnly Property Running() As Boolean
    Get
        Return _Running
    End Get
End Property

The WriteOnly parameter does the opposite and only allows a programmer to assign a value to the property.

Private _RadioStation As Integer
Public WriteOnly Property RadioStation() As Integer
    Set(ByVal value As Integer)
        _RadioStation = value
    End Set
End Property

This leads me directly into the second reason you should always use a get/set in a class, the capacity to cause something to happen when a value is set.

Private _RadioStation As Integer
Public WriteOnly Property RadioStation() As Integer
    Set(ByVal value As Integer)
        _RadioStation = value
        ChangeRadioStation(_RadioStation)
    End Set
End Property

In the above code I am calling a function that would change the Radio Station of the car when the value for the property is changed. This is used most commonly used when you do not want to expose a methods process to a programmer.

So let me post the full class code so far.

Imports System.ComponentModel
Public Class Car

#Region "Properties"

	Private _Colour As String
	Public Property Colour() As String
		Get
			Return _Colour
		End Get
		Set(ByVal value As String)
			_Colour = value
		End Set
	End Property

	<DefaultValue(0)> _
	Private _Speed As Integer
	Public Property Speed() As Integer
		Get
			Return _Speed
		End Get
		Set(ByVal value As Integer)
			_Speed = value
		End Set
	End Property

	Private _Running As Boolean
	Public ReadOnly Property Running() As Boolean
		Get
			Return _Running
		End Get
	End Property

	Private _RadioStation As Integer
	Public WriteOnly Property RadioStation() As Integer
		Set(ByVal value As Integer)
			_RadioStation = value
			ChangeRadioStation(_RadioStation)
		End Set
	End Property

#End Region

#Region "Methods"

	Public Function ChangeSpeed(SpeedChange As Integer) As Integer
		_Speed = _Speed + SpeedChange
		Return _Speed
	End Function

	Public Sub TurnKey()
		_running = Not _running
		' this line does the work of this chunk of code.
                    'If _Running = False Then
		'	_Running = True
		'ElseIf _Running = True Then
		'	_Running = False
		'End If
	End Sub

	Private Sub ChangeRadioStation(stationID As Integer)
		' Set the value of the radio station by doing what needs to be done here.
		' Psedocode
		' if StationID is RadioStation then 
		'   TuneRadio(StationID)
		' else 
		'   raise error not radio station
		' endif
	End Sub
#End Region

End Class

NOTE: One thing of that I just noticed I did automatically was import the System.Componentmodel namespace. I did this so I could set a default value for the Speed property as 0. It has a lot more capacity than that but we will get into that another time.

I consider this Purely Functional programming, and is not meant to be a guide on class design. This is for programmers who want to code and not know the nitty-gritty behind the scenes. All of you CS majors out there that are rolling your eyeballs, get over it. I you want the university computer science explanation I recommend Introduction to Object Oriented Programming Concepts by Nirosh over on CodeProject.com

In the next post we will start talking about Inheritance, Encapsulation, and the dreaded Polymorphism.


r/visualbasic • • Oct 06 '26

Need help reverse-engineering serial COM port communication for a Geoelectric reader machine (Upgrading PEG 2015 project)

8 Upvotes

Hi everyone,

I need urgent assistance with a project upgrade. I am rewriting/upgrading a software application originally built in 2015 (PEG 2015) designed to interface with a geoelectric signal reader machine.

System Setup & Problem Overview:

  • Hardware: Geoelectric measurement machine reading ground electrical signals.

  • Connection: USB-to-Serial connection operating as a virtual COM port (e.g., COM3).

  • Issue: I am unable to establish a working connection between my upgraded application and the hardware. I need to know:

    1. How to properly initialize and open the COM port connection in code.

    2. The exact structure/protocol of the data stream coming from the machine over the cable to the PC.

What I have / What I know so far:

  • I have the legacy binary (PEG 2015.exe) that works with the machine.

  • The device relies on a USB-to-UART/Serial driver (such as FTDI, CH340, or CP210x) exposing a virtual COM port.

Specific Questions / Where I need guidance:

  1. Serial Port Configuration Parameters: What are the standard ways or tools to determine the exact port settings required by the device?

    • Baud rate (e.g., 9600, 19200, 115200)

    • Data bits (e.g., 8)

    • Parity (None, Even, Odd)

    • Stop bits (1 or 2)

    • Flow control (RTS/CTS, XON/XOFF, or None)

  2. COM Port Sniffing & Data Protocol: What is the best workflow/tool to monitor the traffic between PEG 2015.exe and the machine without locking the COM port?

    • Can you recommend lightweight tools (e.g., Serial Port Monitor, Wireshark with USBPcap, IO Ninja, RealTerm) to capture raw ASCII/HEX frames?

    • How can I differentiate between handshake/polling requests sent by the PC and telemetry responses sent by the geoelectric reader?

  3. Decompiling / Inspecting the Legacy .exe**:**

    • What are the recommended tools to decompile or inspect PEG 2015.exe to retrieve the original serial settings and parser routines (e.g., dnSpy/ILSpy for .NET, Ghidra/IDA Free for native binaries)?

Environment & Tech Stack:

  • OS: Windows

  • Target Programming Language for New App: ( Python )

Any guidance, code snippets for port handling, or reverse-engineering methodologies for serial hardware would be greatly appreciated! Thanks in advance!


r/visualbasic • • Dec 22 '25

You can teach an old dog new tricks! 😁

8 Upvotes

I've been progamming in Visual Basic, as a hobby, since the very begining and I've only just discovered 'textfieldparser'. Wow!

What little delimited data parsing I've done in the past was simple comma or tab delimited, pretty easy to split. My latest project involved comma delimited data but some of the fields were in quotes with more commas inside! Simple comma spliting wouldn't work!

I spent quite a while thinking of all the ways I could split the lines with character parsing to get references in the line strings of where it needed spliting the only solution I could think of. This sounded doable, but tricky!

I thought I try a final Google search, saw a reference to the 'textfieldparser' class and wondered what it was.

OMG! Five minutes later I had a test program doing exactly what I needed, just like that!


r/visualbasic • • Nov 26 '25

how to install vb

8 Upvotes

hello I want to install vb on the 2021 edition how to do it ?
or I must download the 2008 edition ?
I want to see it & try it , I know it's so old & barely can do norm tasks


r/visualbasic • • May 13 '25

Beginner learning Visual Basic 16.9 (VB.NET) in 2025

8 Upvotes

As a beginner in 2025, I'm currently learning Visual Basic 16.9 (VB.NET). I've recently started working through 'Mastering Microsoft Visual Basic 2010' by Evangelos Petroutsos and find the language and the Visual Studio IDE integration incredibly intuitive and straightforward. It's proving to be a very effective way to learn. My first programming language was C, which I learned to understand hardware logic and embedded systems (like STM32) as a hobby. However I don´t want to use C with GTK+ for GUI´s and websites. I first tried Python due to its popularity but found the use of a separate tool for drag-and-drop GUI design (like Qt Creator) alongside a Python IDE unintuitive compared to Visual Studio. I think VB.NET is well-suited for developing a wide range of applications. What do you think?


r/visualbasic • • Jan 29 '25

NEW VISUAL BASIC USER

8 Upvotes

I am new to visual basic but very experienced in Excel (and other office apps). I am beginning to learn the power of Visual Basic in doing things I want to achieve, especially in Excel. What is the best way to learn Visual Basic? I can't see any College or Uni courses on it. What do you folks recommend. I am very maths literate (Chemistry Grad), so the complexity of the course need not be too basic (pardon the pun)!


r/visualbasic • • Mar 03 '24

How to run a 1995 vb program in 2024?

8 Upvotes

EDIT - I got everything to run by installing VB3 inside Windows 3.1 inside a Dos emulator. Yay!


old post

I've been doing some data archeology from old floppies my family has held onto for a very long time. One of the interesting items I've been able to recover is two vb programs my dad wrote in 1995, one is a fortune teller that strings together wacky fortunes from 4 different buckets of pre written phrases, another is an arithmetic program where you lift a barbell by getting math problems correct, and it sinks when you get them wrong. I've got the code and executables and other files that together worked as a stand alone application on Windows 95.

I tried to run them on my windows 10 PC and they didn't work. I changed compatibility options on Windows to try it as a win 95, 98 or xp era program but none of those options work. I'm not getting any particular error, just a generic one that the programs cannot be run on this system.

Is there an emulator or something relatively simple that I might be able to run on windows 10 to try these out again? I have no particular vb knowledge or tools right now and not sure where to start.


r/visualbasic • • Mar 07 '23

cheated a little by putting the first "1" in the listbox but Im kinda proud of my low math Fibonacci sequence

Post image
8 Upvotes

r/visualbasic • • Feb 18 '23

Discord server for VB.net?

8 Upvotes

Hello,
Is there a discord server for the .NET framework? I'm hoping I can meet any old users or new users via text or voice channel.