Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. TEXTBOX TEXT REFERRENCE [modified]

TEXTBOX TEXT REFERRENCE [modified]

Scheduled Pinned Locked Moved .NET (Core and Framework)
helpquestion
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Dobrobit
    wrote on last edited by
    #1

    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

    N D J 3 Replies Last reply
    0
    • D Dobrobit

      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

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • D Dobrobit

        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

        D Offline
        D Offline
        Dave Kreskowiak
        wrote on last edited by
        #3

        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

        D 1 Reply Last reply
        0
        • D Dave Kreskowiak

          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

          D Offline
          D Offline
          Dobrobit
          wrote on last edited by
          #4

          105 textboxes is nothing in my program.The aproprate number is7x 30 = 210 textboxes I have solved the problem myself through split methodes Thanks

          1 Reply Last reply
          0
          • D Dobrobit

            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

            J Offline
            J Offline
            Jack Vanderhorst
            wrote on last edited by
            #5

            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.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups