I think it’s time again to teach you on the features that can be found on my program like Hotel Reservation System (VB.NET).
A while ago I received a comment on how to pass value from one form to another form. Although I have already done this in almost all of my program but I know that some of you miss the opportunity to analyze it due to the complexity of the program.
Without further ado, let us take the example from Hotel Reservation System (VB.NET).
In frmRoomWindow form you can see the following code:
The line two and three will pass a value to State and RoomNumber variable. In order to pass this value the receiving form which is frmCheckIn needs to define these variables first, as shown below:
As you can see in the line eight and nine RoomNumber and State is define here as public variable. Declaring this variable as public is very important to receive a value from other form, or else it cannot receive any value.
As it is already been defined at the module level of the form then you can call it anywhere in your code like in the Form_Load event. Example:
I hope this helps.
Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.
Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.
FOR YOUR OWN SAFETY, PLEASE:
1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.