textbox changes

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Hrvoje Voda

    #1

    textbox changes

    I have 4 textBoxes.
    I would like to see if a user has write something in any of them, so that I
    can ask him to save it into dataset.
    How could I check for all 4 at once, so I don't have to ask for every one in
    single ?

    Hrcko


  • Alan Pretre

    #2
    Re: textbox changes

    "Hrvoje Voda" <hrvoje.voda@lu atech.com> wrote in message
    news:d5t54b$eja $1@ss405.t-com.hr...[color=blue]
    >I have 4 textBoxes.
    > I would like to see if a user has write something in any of them, so that
    > I can ask him to save it into dataset.
    > How could I check for all 4 at once, so I don't have to ask for every one
    > in single ?
    >
    > Hrcko
    >[/color]

    Hi. Catch the TextChanged event in all of the text boxes and set a boolean
    in your code that the text has changed. If you wish, you could send the
    event for all of the text boxes to the same event handler, to avoid
    duplication.

    -- Alan


    Comment

    • Hrvoje Voda

      #3
      Re: textbox changes

      I put a bool into TextChanged event but it's always true.

      Hrcko


      "Alan Pretre" <alanpretre@new sgroup.nospam> wrote in message
      news:eD2AatjVFH A.4056@TK2MSFTN GP15.phx.gbl...[color=blue]
      > "Hrvoje Voda" <hrvoje.voda@lu atech.com> wrote in message
      > news:d5t54b$eja $1@ss405.t-com.hr...[color=green]
      >>I have 4 textBoxes.
      >> I would like to see if a user has write something in any of them, so that
      >> I can ask him to save it into dataset.
      >> How could I check for all 4 at once, so I don't have to ask for every one
      >> in single ?
      >>
      >> Hrcko
      >>[/color]
      >
      > Hi. Catch the TextChanged event in all of the text boxes and set a
      > boolean in your code that the text has changed. If you wish, you could
      > send the event for all of the text boxes to the same event handler, to
      > avoid duplication.
      >
      > -- Alan
      >
      >[/color]


      Comment

      • Alan Pretre

        #4
        Re: textbox changes

        "Hrvoje Voda" <hrvoje.voda@lu atech.com> wrote in message
        news:d5v3gf$ipq $1@ss405.t-com.hr...[color=blue]
        >I put a bool into TextChanged event but it's always true.[/color]

        Hi. The TextChanged event will get fired also when you are loading the
        textbox programatically . You need to make sure that you initialize your
        boolean to false AFTER you have done the initial loading of the textbox
        contents, but BEFORE the user has a chance to change them.

        -- Alan


        Comment

        Working...