Results 1 to 14 of 14

Thread: [RESOLVED] [2008] Textbox issue

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2005
    Posts
    82

    Resolved [RESOLVED] [2008] Textbox issue

    Ok I have a textbox that when someone types in it another textbox will have the exact same text. Easy I know.

    Code:
    Private Sub TextBox9_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox9.TextChanged
            TextBox12.Text = TextBox9.Text
        End Sub
    That works fine normally but I am using My.Settings on each text box that get loaded upon the form load. Is there anyway around this from not messing up?

    For some reason it doesnt work properly if your using My.Settings but still would like to use the function.

    Thanks.

  2. #2
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    Re: [2008] Textbox issue

    what does messing up mean?
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Aug 2005
    Posts
    82

    Re: [2008] Textbox issue

    When you enter text into textbox9, textbox12 changes but then textbox9 clears it self. It seems only 1 character can be entered into textbox9, then it clears itself out. And textbox12 only hold the last character you typed.

  4. #4
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,424

    Re: [2008] Textbox issue

    is all the text in textbox9 highlighted before it happens?

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Aug 2005
    Posts
    82

    Re: [2008] Textbox issue

    Nothing is highlighted in textbox9, just a flashing cursor.

    There is no text in textbox9 when the form loads but there is text in textbox12 when it loads.

  6. #6
    PowerPoster JuggaloBrotha's Avatar
    Join Date
    Sep 2005
    Location
    Lansing, MI; USA
    Posts
    4,286

    Re: [2008] Textbox issue

    I think you should post the entire form's code that's relevant to Textbox9 and Textbox12
    Currently using VS 2015 Enterprise on Win10 Enterprise x64.

    CodeBank: All ThreadsColors ComboBoxFading & Gradient FormMoveItemListBox/MoveItemListViewMultilineListBoxMenuButtonToolStripCheckBoxStart with Windows

  7. #7
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    Re: [2008] Textbox issue

    i second jug
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Aug 2005
    Posts
    82

    Re: [2008] Textbox issue

    This is the complete code for what im trying to do:

    vb Code:
    1. Private Sub TextBox9_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox9.TextChanged
    2.         TextBox12.Text = TextBox9.Text
    3.     End Sub

    That works great but when you bind those two textboxes to the application settings it doesnt work properly. Try it for you self. Make two text boxes, then add the above code and run the program, it works fine.

    But then when you set each textbox to be remember and saved when the program loads under the application settings it doesnt work.

  9. #9
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    Re: [2008] Textbox issue

    where do you load the textbox from my.settings
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  10. #10

    Thread Starter
    Lively Member
    Join Date
    Aug 2005
    Posts
    82

    Re: [2008] Textbox issue

    I use the following code on the form load

    vb Code:
    1. My.Settings.Reload()

    on form close:
    vb Code:
    1. My.Settings.Save()

  11. #11

    Thread Starter
    Lively Member
    Join Date
    Aug 2005
    Posts
    82

    Re: [2008] Textbox issue

    I should say that I dont have any problems reloading the text back into any textboxes.

    Just when added the textbox12.text = textbox9.text it doesnt do what its supposed to.

  12. #12
    PowerPoster JuggaloBrotha's Avatar
    Join Date
    Sep 2005
    Location
    Lansing, MI; USA
    Posts
    4,286

    Re: [2008] Textbox issue

    Quote Originally Posted by nutt318
    This is the complete code for what im trying to do:

    vb Code:
    1. Private Sub TextBox9_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox9.TextChanged
    2.         TextBox12.Text = TextBox9.Text
    3.     End Sub

    That works great but when you bind those two textboxes to the application settings it doesnt work properly. Try it for you self. Make two text boxes, then add the above code and run the program, it works fine.

    But then when you set each textbox to be remember and saved when the program loads under the application settings it doesnt work.
    So don't bind them, in the form load event manually set their Text properties then in the form close event manually grab the Text
    Currently using VS 2015 Enterprise on Win10 Enterprise x64.

    CodeBank: All ThreadsColors ComboBoxFading & Gradient FormMoveItemListBox/MoveItemListViewMultilineListBoxMenuButtonToolStripCheckBoxStart with Windows

  13. #13

    Thread Starter
    Lively Member
    Join Date
    Aug 2005
    Posts
    82

    Re: [2008] Textbox issue

    But I need to save these settings that are entered. If a user changes the settings and closes the program these need to be saved. So what your saying I dont think will work for me. Unless im not getting something.

  14. #14

    Thread Starter
    Lively Member
    Join Date
    Aug 2005
    Posts
    82

    Re: [2008] Textbox issue

    Found the Fix:

    Removed the my settings binding from textbox12 and then on form load and close i saved that textbox12.text to a my.setting.

    Works good now, thanks JuggaloBrotha

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width