• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

Programming Visual Basic Help Needed !!

GT08

New Member
Joined
Nov 11, 2008
Messages
18 (0.00/day)
1. On the form, select txtCola (it is the input form for Cola).
2. Once it is selected, hit delete.
3. Rinse and repeat for txtLemonade.
4. Now that they are both deletected, select one of the other txt##### controls like the one right below where txtLemonade used to be.
5. Right click on it and select "Copy."
6. Paste it into one of the open spaces. If it refuses to go in, simply drag and drop it in.
7. Repeat for the other one.
8. Now just rename them to what they are supposed to be: top one "txtCola" and bottom one "txtLemonade."

VS messed up some how on them with designer code.



Click on the control you want to check/change and alter TabStop property. The values start at 1 and work up.

The TabStop is the order in which the tab button proceeds through the form. For instance, if you have 3 controls with tab stop 1, 2, 3 in order while you currently have focus on 1, should you press tab, it will go to 2. If you press tab again, it will go to 3. If you press tab again, it will go back to 1.

This feature is mostly for people that will be using your program without a mouse. You can easily test it on your compiled application to see if the order is good.

Thank you for this. The tab stop is a bit hard to comprehend. The controls your talking about would be what? I'd initially think that it's the TableLayoutPanel (TLP). Am I correct?

As I am not familiar with the tab stop could you guide me on how to do this step by step please?
 

FordGT90Concept

"I go fast!1!11!1!"
Joined
Oct 13, 2008
Messages
26,259 (4.63/day)
Location
IA, USA
System Name BY-2021
Processor AMD Ryzen 7 5800X (65w eco profile)
Motherboard MSI B550 Gaming Plus
Cooling Scythe Mugen (rev 5)
Memory 2 x Kingston HyperX DDR4-3200 32 GiB
Video Card(s) AMD Radeon RX 7900 XT
Storage Samsung 980 Pro, Seagate Exos X20 TB 7200 RPM
Display(s) Nixeus NX-EDG274K (3840x2160@144 DP) + Samsung SyncMaster 906BW (1440x900@60 HDMI-DVI)
Case Coolermaster HAF 932 w/ USB 3.0 5.25" bay + USB 3.2 (A+C) 3.5" bay
Audio Device(s) Realtek ALC1150, Micca OriGen+
Power Supply Enermax Platimax 850w
Mouse Nixeus REVEL-X
Keyboard Tesoro Excalibur
Software Windows 10 Home 64-bit
Benchmark Scores Faster than the tortoise; slower than the hare.
It's really not that important...

Everything in the form is a control from TableLayoutPanel to Labels to TextBoxes. The TabStop system works like a tree in that when it starts, it looks at all the controls it owns. In your case, it's mostly GroupBoxes. The TabStop of the group boxes will determine which order the group boxes are selected when the tab key is pressed. But, because GroupBox is a container control (meaning it holds other controls), the tab heirarchy does not stop there. If your groupbox is tabbed to, it will then tab through it's children (in your case, just the TableLayoutPanel). Because a TLP is not focusable, it will jump to the control hierarchy it contains. It will continue this parent -> children -> parent -> children loop until it reaches the very last (defined by TabStop hierarchy) control on the form at which point, it returns to the beginning.

Yes, that sounds complex. The best way to grasp it is to just play with it. Run your application and start hitting tab key. If you notice the order is not in the way you expect it, alter the TabStops until it is. Visual Studio forces the usage of TabStop on pretty much every control so, if the order is really messed up, just start at the beginning with 1 and work your way down. Visual Studio makes sure there are no collisions.
 

GT08

New Member
Joined
Nov 11, 2008
Messages
18 (0.00/day)
Thank you for your reply. I have understood a lot from this thread and I thank you for this.

I am now trying to enhance my finished program by adding extras to it.

Here is what I want to achieve in my final program:

I would still like to use this program but at this stage I want this system to communicate with the system in the kitchen which would display the orders to be cooked.

Here are some ideas I was thinking of:

By using an existing form, I create a button and the display name would be "Orders to be cooked".
Once I click on that button, it would take me to another form which would display all the Pizzas that needs to be cooked corresponding to the quantities in the first form. It would be something like "Cheese and Tomato Pizza on a Traditional Base with extra cheese topping = 3.

I think in order for this to work, I would need to input the details of what kind of Pizza to create. The previous version was good but now I need this system to communicate with the kitchen to display the orders to be cooked.


I have no idea what the codes would be....
 

FordGT90Concept

"I go fast!1!11!1!"
Joined
Oct 13, 2008
Messages
26,259 (4.63/day)
Location
IA, USA
System Name BY-2021
Processor AMD Ryzen 7 5800X (65w eco profile)
Motherboard MSI B550 Gaming Plus
Cooling Scythe Mugen (rev 5)
Memory 2 x Kingston HyperX DDR4-3200 32 GiB
Video Card(s) AMD Radeon RX 7900 XT
Storage Samsung 980 Pro, Seagate Exos X20 TB 7200 RPM
Display(s) Nixeus NX-EDG274K (3840x2160@144 DP) + Samsung SyncMaster 906BW (1440x900@60 HDMI-DVI)
Case Coolermaster HAF 932 w/ USB 3.0 5.25" bay + USB 3.2 (A+C) 3.5" bay
Audio Device(s) Realtek ALC1150, Micca OriGen+
Power Supply Enermax Platimax 850w
Mouse Nixeus REVEL-X
Keyboard Tesoro Excalibur
Software Windows 10 Home 64-bit
Benchmark Scores Faster than the tortoise; slower than the hare.
I would still like to use this program but at this stage I want this system to communicate with the system in the kitchen which would display the orders to be cooked.
Use UDP packets in System.Net. There's a lot of guides on how to send/receive packets via UDP in .NET. Here's an example: http://www.c-sharpcorner.com/Upload...2005040054AM/simpleTcpUdpServerClientPL2.aspx

Remember that a UDP has a limited packet size of around 1024 bytes.



By using an existing form, I create a button and the display name would be "Orders to be cooked".
Once I click on that button, it would take me to another form which would display all the Pizzas that needs to be cooked corresponding to the quantities in the first form. It would be something like "Cheese and Tomato Pizza on a Traditional Base with extra cheese topping = 3.
You can make the second form the same way you made the first. To add it, just right click on the project and select Add New Windows Form (or some such). To call that second from from your first (aka Parent) form, just do something like this...
Code:
Dim ChildForm As New ChildFormName()
' Prep the form here like pass it data to display and the like...
' Then display:
ChildForm.Show() ' or ChildForm.ShowDialog()
Show means the original form is still accessible--you can jump between the parent and child form. ShowDialog means the parent cannot be accessed until the child form is closed. Use ShowDialog if the parent requires data entered in the child.

You'd put that code in a button click sub, for instance.
 

GT08

New Member
Joined
Nov 11, 2008
Messages
18 (0.00/day)
Use UDP packets in System.Net. There's a lot of guides on how to send/receive packets via UDP in .NET. Here's an example: http://www.c-sharpcorner.com/Upload...2005040054AM/simpleTcpUdpServerClientPL2.aspx

Remember that a UDP has a limited packet size of around 1024 bytes.

Sorry but this isn't what I'm looking for really. A bit too advanced for me at this stage.

For example; on my program if I order 1 Cheese and Tomato Pizza with extra cheese topping on a traditional base and 1 cola.

How can I process the pizza bit to the other form to display what the chef should cook?

So on the other form I want it to display 1 Cheese and Tomato Pizza with extra cheese on a traditional base. Of course many orders will be different so the information it displays on the other form would have to correspond to the order.

If someone else orders 1 Cheese and Tomato Pizza with extra cheese on a traditional base, 1 MeatFeast on a thin and crispy base then the order I want the chef to cook would be displayed as 1 Cheese and Tomato Pizza with extra cheese on traditional base and 1 MeatFeast on a thin and crispy base.

These information would be on a different form.

What I would want in the system:
- Information of the Pizza orders to be displayed on a different form. Every time has to correspond to the different orders.
- On the first form, once I click on Process Order, I want a message box warning me if I should continue with my order. Yes to Continue and No to Stop the order.
- Once it has clicked on Yes to continue, another form automatically comes up with the pizza list the chef would have to cook. Whereas for the drinks, it would also be displayed but in a different section of the form.

Do you see where I am trying to go with this?
 

FordGT90Concept

"I go fast!1!11!1!"
Joined
Oct 13, 2008
Messages
26,259 (4.63/day)
Location
IA, USA
System Name BY-2021
Processor AMD Ryzen 7 5800X (65w eco profile)
Motherboard MSI B550 Gaming Plus
Cooling Scythe Mugen (rev 5)
Memory 2 x Kingston HyperX DDR4-3200 32 GiB
Video Card(s) AMD Radeon RX 7900 XT
Storage Samsung 980 Pro, Seagate Exos X20 TB 7200 RPM
Display(s) Nixeus NX-EDG274K (3840x2160@144 DP) + Samsung SyncMaster 906BW (1440x900@60 HDMI-DVI)
Case Coolermaster HAF 932 w/ USB 3.0 5.25" bay + USB 3.2 (A+C) 3.5" bay
Audio Device(s) Realtek ALC1150, Micca OriGen+
Power Supply Enermax Platimax 850w
Mouse Nixeus REVEL-X
Keyboard Tesoro Excalibur
Software Windows 10 Home 64-bit
Benchmark Scores Faster than the tortoise; slower than the hare.
How can I process the pizza bit to the other form to display what the chef should cook?
I knew I forgot to comment on something...

There are two ways you can pass data from one class (Form) to another (you can use both at the same time too):
1) Through initialization parameters. Defined as:
Code:
' This class inherits a Form...
Public Class MyForm
  ' This line is already defined in FormName.Designer.vb so
  ' this is just an example...
  Private txtProperty As New System.Windows.Forms.TextBox()

  Public Sub New(ByVal param1 As String, ByVal param2 As String, ByVal param3 As String, ...)
    txtProperty.Text = param1 & param2 & param3
  End Sub
End Class
Example of usage:
Code:
Dim ChildForm As New MyForm(param1, param2, param3, ...)
ChildForm.Show()
2) Through public varibles. These can take many shapes. In your case, a public accessor/mutator is probably the best way to go--that is, read and write access to an internally defined variable (this example allows an instance of the class to access only the Text field of "txtProperty"):
Code:
' This class inherits a Form...
Public Class MyForm
  ' This line is already defined in FormName.Designer.vb so
  ' this is just an example...
  Private txtProperty As New System.Windows.Forms.TextBox()

  ' The property...
  Public Property Text() As String
    ' Accessor
    Get
      Return txtProperty.Text
    End Get
    ' Mutator
    Set(ByVal value As String)
      txtProperty.Text = value
    End Set
  End Property
End Class

Then, in your parent form, it looks something like this:
Code:
' this is in a sub that calls the new form
Dim ChildForm As New MyForm()
ChildForm.Text = "Text Message to Display."
ChildForm.Show()

I think you should be able to figure out how best to handle the specifics from that...

...but it does sound like you need to establish a shared table of data (a List of Orders).
 
Last edited:
Top