TEXTBOX TEXT REFERRENCE [modified]
-
I have 2 forms Form1 and Form2 In form1 I have 105 small textboxes that are being filled through listbox This is the code used in Form2: Click event :| Dim fi As New Form1 TextBox1.Text = TextBox1.Text & _ "cast(case when Vert1 = " & fi.TextBox23.Text & " then '1' else '0' end as int)+" & vbCrLf & _ "cast(case when Vert2 = " & fi.TextBox24.Text & " then '1' else '0' end as int)+" & vbCrLf & _ "cast(case when Vert3 = " & fi.TextBox25.Text & " then '1' else '0' end as int)+" & vbCrLf & _ "cast(case when Vert4 = " & fi.TextBox26.Text & " then '1' else '0' end as int)+" & vbCrLf & _ "cast(case when Vert5 = " & fi.TextBox27.Text & " then '1' else '0' end as int)+" & vbCrLf & _ "cast(case when Vert6 = " & fi.TextBox28.Text & " then '1' else '0' end as int)+" & vbCrLf &_ "" & "" & "" In textbox1 no value is writen for textbox23 to textbox28 of form1 Can sone one help?
modified on Tuesday, July 7, 2009 7:36 AM
-
I have 2 forms Form1 and Form2 In form1 I have 105 small textboxes that are being filled through listbox This is the code used in Form2: Click event :| Dim fi As New Form1 TextBox1.Text = TextBox1.Text & _ "cast(case when Vert1 = " & fi.TextBox23.Text & " then '1' else '0' end as int)+" & vbCrLf & _ "cast(case when Vert2 = " & fi.TextBox24.Text & " then '1' else '0' end as int)+" & vbCrLf & _ "cast(case when Vert3 = " & fi.TextBox25.Text & " then '1' else '0' end as int)+" & vbCrLf & _ "cast(case when Vert4 = " & fi.TextBox26.Text & " then '1' else '0' end as int)+" & vbCrLf & _ "cast(case when Vert5 = " & fi.TextBox27.Text & " then '1' else '0' end as int)+" & vbCrLf & _ "cast(case when Vert6 = " & fi.TextBox28.Text & " then '1' else '0' end as int)+" & vbCrLf &_ "" & "" & "" In textbox1 no value is writen for textbox23 to textbox28 of form1 Can sone one help?
modified on Tuesday, July 7, 2009 7:36 AM
Dobrobit wrote:
Can sone one help?
Yes, give up, change majors now, development doesn't seem your cup of tea.
only two letters away from being an asset
-
I have 2 forms Form1 and Form2 In form1 I have 105 small textboxes that are being filled through listbox This is the code used in Form2: Click event :| Dim fi As New Form1 TextBox1.Text = TextBox1.Text & _ "cast(case when Vert1 = " & fi.TextBox23.Text & " then '1' else '0' end as int)+" & vbCrLf & _ "cast(case when Vert2 = " & fi.TextBox24.Text & " then '1' else '0' end as int)+" & vbCrLf & _ "cast(case when Vert3 = " & fi.TextBox25.Text & " then '1' else '0' end as int)+" & vbCrLf & _ "cast(case when Vert4 = " & fi.TextBox26.Text & " then '1' else '0' end as int)+" & vbCrLf & _ "cast(case when Vert5 = " & fi.TextBox27.Text & " then '1' else '0' end as int)+" & vbCrLf & _ "cast(case when Vert6 = " & fi.TextBox28.Text & " then '1' else '0' end as int)+" & vbCrLf &_ "" & "" & "" In textbox1 no value is writen for textbox23 to textbox28 of form1 Can sone one help?
modified on Tuesday, July 7, 2009 7:36 AM
105 text boxes on a single form?!?! There are so many things wrong with this it's silly. First, your control names suck. Calling them "TextBox_n_" means nothing but a headache. I would NOT want to come in to maintain your code. For each click event, you're adding the contents of the TextBox1 to itself, thus doubling its content every time you click a button. You didn't mention any kind of a problem you're having, so it's pretty much impossible to tell you what you did wrong, other than the horrible design choices.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
105 text boxes on a single form?!?! There are so many things wrong with this it's silly. First, your control names suck. Calling them "TextBox_n_" means nothing but a headache. I would NOT want to come in to maintain your code. For each click event, you're adding the contents of the TextBox1 to itself, thus doubling its content every time you click a button. You didn't mention any kind of a problem you're having, so it's pretty much impossible to tell you what you did wrong, other than the horrible design choices.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
I have 2 forms Form1 and Form2 In form1 I have 105 small textboxes that are being filled through listbox This is the code used in Form2: Click event :| Dim fi As New Form1 TextBox1.Text = TextBox1.Text & _ "cast(case when Vert1 = " & fi.TextBox23.Text & " then '1' else '0' end as int)+" & vbCrLf & _ "cast(case when Vert2 = " & fi.TextBox24.Text & " then '1' else '0' end as int)+" & vbCrLf & _ "cast(case when Vert3 = " & fi.TextBox25.Text & " then '1' else '0' end as int)+" & vbCrLf & _ "cast(case when Vert4 = " & fi.TextBox26.Text & " then '1' else '0' end as int)+" & vbCrLf & _ "cast(case when Vert5 = " & fi.TextBox27.Text & " then '1' else '0' end as int)+" & vbCrLf & _ "cast(case when Vert6 = " & fi.TextBox28.Text & " then '1' else '0' end as int)+" & vbCrLf &_ "" & "" & "" In textbox1 no value is writen for textbox23 to textbox28 of form1 Can sone one help?
modified on Tuesday, July 7, 2009 7:36 AM
fi.TextBox23-28 are on a form that was just instantiated. Unless there is something in the default constructor of Form1 that changes this, they will be empty by default.