Hi everybody,
After some research, Ive missed to find out solution to this problem:
Im using VB to read a 4 sensor kit. Up till now Ive been able to read and interrogate the kit.
To improve my work I want to show only the existing sensors, if Ive 4 sensors Ill create and show 4 textbox, if i only have 2 sensors I dont want to show unnecessary textbox If Im using only 2 sensors I know that i can use the hide command, but if more kits are added (*4 sensors each) this is not a good solution...
Here the actual code in example:
![Name: Image1.png
Views: 46
Size: 184.0 KB]()
I dont know if it is possible to use the textbox object with increment, something as
With a and c defined by me or the values obtained
For i=1 to c
If condition a = true then
Create.textbox(i)
Textbox(i).Location = New Point(10, 10)
End if
next
Most of all I want to be able to create/locate a new textbox whenever certain conditions are acquired.
Thank you for the help in advance.
After some research, Ive missed to find out solution to this problem:
Im using VB to read a 4 sensor kit. Up till now Ive been able to read and interrogate the kit.
To improve my work I want to show only the existing sensors, if Ive 4 sensors Ill create and show 4 textbox, if i only have 2 sensors I dont want to show unnecessary textbox If Im using only 2 sensors I know that i can use the hide command, but if more kits are added (*4 sensors each) this is not a good solution...
Here the actual code in example:
Code:
If nbrkit = 1 Then
AddHandler evalkit1.FrameReceived, (AddressOf evalKit_FrameReceived)
AddHandler evalkit1.Connected, (AddressOf evalKit_Connected)
evalkit1.Connect(portNames(0))
TextBox10.Hide()
TextBox11.Hide()
TextBox12.Hide()
TextBox13.Hide()
TextBox14.Hide()
TextBox15.Hide()
TextBox16.Hide()
TextBox17.Hide()
TextBox18.Hide()
TextBox19.Hide()
TextBox20.Hide()
TextBox21.Hide()
TextBox22.Hide()
TextBox23.Hide()
TextBox24.Hide()
TextBox25.Hide()
Label15.Hide()
Label14.Hide()
Label13.Hide()
Label20.Hide()
Label21.Hide()
Label22.Hide()
Me.Location = New Point(10, 10)
Me.ClientSize = New System.Drawing.Size(380, 370)
ElseIf nbrkit = 2 Then
AddHandler evalkit1.FrameReceived, (AddressOf evalKit_FrameReceived)
AddHandler evalkit1.Connected, (AddressOf evalKit_Connected)
evalkit1.Connect(portNames(0))
AddHandler evalkit2.FrameReceived, (AddressOf evalKit_FrameReceived)
AddHandler evalkit2.Connected, (AddressOf evalKit_Connected)
evalkit2.Connect(portNames(1))
TextBox18.Hide()
TextBox19.Hide()
TextBox20.Hide()
TextBox21.Hide()
TextBox22.Hide()
TextBox23.Hide()
TextBox24.Hide()
TextBox25.Hide()
Label20.Hide()
Label21.Hide()
Label22.Hide()
Me.Location = New Point(10, 10)
Me.ClientSize = New System.Drawing.Size(650, 370)
ElseIf nbrkit = 3 Then
AddHandler evalkit1.FrameReceived, (AddressOf evalKit_FrameReceived)
AddHandler evalkit1.Connected, (AddressOf evalKit_Connected)
evalkit1.Connect(portNames(0))
AddHandler evalkit2.FrameReceived, (AddressOf evalKit_FrameReceived)
AddHandler evalkit2.Connected, (AddressOf evalKit_Connected)
evalkit2.Connect(portNames(1))
AddHandler evalkit3.FrameReceived, (AddressOf evalKit_FrameReceived)
AddHandler evalkit3.Connected, (AddressOf evalKit_Connected)
evalkit3.Connect(portNames(2))
I dont know if it is possible to use the textbox object with increment, something as
With a and c defined by me or the values obtained
For i=1 to c
If condition a = true then
Create.textbox(i)
Textbox(i).Location = New Point(10, 10)
End if
next
Most of all I want to be able to create/locate a new textbox whenever certain conditions are acquired.
Thank you for the help in advance.