CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Bind a textfield to an object varaible?

  1. #1
    Join Date
    Feb 2003
    Location
    Sunny Glasgow!
    Posts
    258

    Bind a textfield to an object varaible?

    I'm not sure if what i am asking about is possible, but here goes....

    If i have a simple GUI with a textfield 'address line1' and i have an address object with a string variable for 'line1', is it possible to bind these two so that when data is entered in the textfield, it becomes the value assigned to the obejct?

    I am trying to save data to a db from my UI, but a utility method to set all the variables before the save seems a bit longwinded.
    Is there a clever way to do this?

  2. #2
    Join Date
    Jun 1999
    Location
    Eastern Florida
    Posts
    3,858

    Re: Bind a textfield to an object varaible?

    when data is entered in the textfield, it becomes the value assigned to the obejct
    Yes. There are several ways to use listeners to the textfield to be called when data is entered.
    One is the ActionListener for when Enter is pressed after the data is entered.
    Others are able to look at it char by char as the data is entered. For that look at DocumentListener
    Norm

  3. #3
    Join Date
    Jun 1999
    Location
    Eastern Florida
    Posts
    3,858

    Re: Bind a textfield to an object varaible?

    when data is entered in the textfield, it becomes the value assigned to the obejct
    Yes. There are several ways to use listeners to the textfield to be called when data is entered.
    One is the ActionListener for when Enter is pressed after the data is entered.
    Others are able to look at it char by char as the data is entered. For that look at DocumentListener
    Norm

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)