none
Using Contacts Database on Form Region and Making a Command Button Interact with a Text Box RRS feed

  • Question

  • Hi!

    I asked a question earlier about how to write the code behind a form region.  Someone posted a very helpful video that showed me how to easily make each piece of your form region have different actions ex. making the click of a button do something. Essentially I want to be able to filter through my contacts based on certain information entered in the text boxes.  I am having two problem right now.  First, I don't know how to add my contacts list as a database.  Second, I don't know how to get the button to read the information the user enters into the textbox and use that information to filter the data.  Any suggestions are greatly appreciated!

    Krista

    Also, I am using Visual Studio 2010 and I am writing the code in visual basic.

    Friday, June 15, 2012 5:47 PM

Answers

  • Hi kristakay,

    Thanks for posting in the MSDN Forum.

    As far as I know, that you will access your controls in events of the form region if you designed your form region in Visual Studio IDE. As usual, we will do initialization of the form region's controls in form region's Load event. And do changes on controls event such as Button's click event. You are able to access your form region controls in those event like access winform's controls.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    • Marked as answer by kristakay Tuesday, June 19, 2012 11:58 AM
    Monday, June 18, 2012 6:49 AM
    Moderator

All replies

  • Hi kristakay,

    Thanks for posting in the MSDN Forum.

    As far as I know, that you will access your controls in events of the form region if you designed your form region in Visual Studio IDE. As usual, we will do initialization of the form region's controls in form region's Load event. And do changes on controls event such as Button's click event. You are able to access your form region controls in those event like access winform's controls.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    • Marked as answer by kristakay Tuesday, June 19, 2012 11:58 AM
    Monday, June 18, 2012 6:49 AM
    Moderator
  • How would I filter information from a data set?  I tried using the example on http://msdn.microsoft.com/en-us/library/system.data.dataview.rowfilter(v=vs.71).aspx and putting the code in the method for the click of button1, but when I click the button nothing happens.  I want to be able to enter a city into one text box and the number of people in another text box and then click the button and I want the data set to be filtered based on the two values I just entered.  What am I doing wrong? 
    Monday, June 18, 2012 3:28 PM
  • Hi Kristakay,

    Woudl you please tell me whether your create your form region via a ofs file or IDE customized?

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    Tuesday, June 19, 2012 5:35 AM
    Moderator
  • Thank you, I actually solved my problem so I don't need any more help :)
    Tuesday, June 19, 2012 11:57 AM