| | |
Location Issue With Controls
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Mar 2008
Posts: 7
Reputation:
Solved Threads: 0
Hi all,
I am working on a simple form for work, which has multiple questions (labels) and text boxes and combo boxes (to answer the questions).
My issue is that i do not wish to show all the questions right from the start. Some questions will remain non-visible, until a previous question is answered by selecting either "Yes" or "No" from a combo box.
My problem is that, when i select "Yes" i have asked that the next "Label" be made visible which it does and that the next "Textbox or Combobox" be made visible, which it also does. BUT where as it places the label right underneath the previous question, it places the "Textbox or Combobox" at the bottom of the page, which i do not want.
I have already tried locking the location of the "Textbox or Combobox" but with no joy.
I also have Autoscroll enable on the form these controls are in.
Here is the code i am using:
If anyone could make some suggestions on how to stop this, that would be geat.
Thankyou
I am working on a simple form for work, which has multiple questions (labels) and text boxes and combo boxes (to answer the questions).
My issue is that i do not wish to show all the questions right from the start. Some questions will remain non-visible, until a previous question is answered by selecting either "Yes" or "No" from a combo box.
My problem is that, when i select "Yes" i have asked that the next "Label" be made visible which it does and that the next "Textbox or Combobox" be made visible, which it also does. BUT where as it places the label right underneath the previous question, it places the "Textbox or Combobox" at the bottom of the page, which i do not want.
I have already tried locking the location of the "Textbox or Combobox" but with no joy.
I also have Autoscroll enable on the form these controls are in.
Here is the code i am using:
Private Sub comboboxQuestion11_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles comboboxQuestion11.SelectedIndexChanged
'If the product does need to be set to a specific tone, then this label is made visible'
If comboboxQuestion11.Text = "Yes" Then
lblQuestion12.Visible = True
Else : lblQuestion12.Visible = False
End If
'If the product does need to be set to a specific tone, then this textbox is made visible'
If comboboxQuestion11.Text = "Yes" Then
txtboxQuestion12.Visible = True
Else : txtboxQuestion12.Visible = False
End If
End SubIf anyone could make some suggestions on how to stop this, that would be geat.
Thankyou
post a screenshot
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
So, Please do something before post your thread.
* PM Asking will be ignored *
why u put box behind another control?
you want to show first textbox after user select yes on first combo box.right?
set first textbox visible = false when form load then after user select yes u can set visible to true. so u don't have to put box behind combox.
See this example :
you want to show first textbox after user select yes on first combo box.right?
set first textbox visible = false when form load then after user select yes u can set visible to true. so u don't have to put box behind combox.
See this example :
vb.net Syntax (Toggle Plain Text)
Private Sub Tes2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load TextBox1.Visible = False With ComboBox1.Items .Add("yes") .Add("no") End With End Sub Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged If ComboBox1.SelectedItem = "yes" Then TextBox1.Visible = True Else TextBox1.Visible = False End If End Sub
Last edited by Jx_Man; Apr 13th, 2008 at 8:07 pm.
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
So, Please do something before post your thread.
* PM Asking will be ignored *
![]() |
Other Threads in the VB.NET Forum
- Previous Thread: Checking against a random number
- Next Thread: Issue with operators
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
"crystal .net .net2005 2008 access add advanced application array assignment basic box button buttons center click code combo convert cpu data database datagrid datagridview dissertation dissertations dissertationthesis dosconsolevb.net editvb.net employees error excel exists firewall forms function image images isnumericfuntioncall listview login map math memory mobile module msaccess mssqlbackend mysql navigate net number opacity page pan picturebox picturebox2 port print printing printpreview problem record regex reports" reuse right-to-left save savedialog search serial socket sorting sql sqldatbase storedprocedure string structures studio temp textbox timer txttoxmlconverter upload useraccounts usercontol usercontrol vb vb.net vb.nettoolboxvisualbasic2008sidebar vb2008 vbnet vista visual visualbasic visualbasic.net web winsock wpf xml






