Closed Thread
Results 1 to 2 of 2

Thread: Windows form question (select a value from childform and populate in parent form)

  1. #1
    yasinirshad is offline Newbie
    Join Date
    Nov 2007
    Posts
    3
    Rep Power
    0

    Windows form question (select a value from childform and populate in parent form)

    Hi,

    How to select a value from a ComboBox / Listbox on the newly opened form (Childform), and send this value immediately on select to the opener parent form (Parent Form)

    The clickable button which will open a listbox should be placed next to textbox control(The size of the textbox is large enough to hold it) on parent form. It is required that we use a listbox populated with some values in child form.When the user selects a value(text) in the listbox,

    1) the listbox should disappear.

    2) The text selected should be automatically inserted into the textbox. (on parent form)

    Any alternatives ?

    Thanks.

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Join Date
    Aug 2006
    Posts
    11,209
    Blog Entries
    6
    Rep Power
    101
    Simple, just add this code in the child form

    Code:
    Private Sub List1_Click()
    List1.Visible = False
    Form1.Text1.Text = List1.Text
    End Sub
    List1 is the list in the child form
    form1 is the parent forum
    text1 is the textbox that will hold the value on the parent form.

    Hope it helped.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 8
    Last Post: 07-05-2011, 05:56 AM
  2. C# calling parent functions from child form
    By NeedHelp in forum C# Programming
    Replies: 13
    Last Post: 06-23-2010, 07:06 AM
  3. Quick Question - open a new Windows Form Application
    By JakeWindu in forum C# Programming
    Replies: 4
    Last Post: 01-31-2010, 08:53 AM
  4. Make Parent Form stop when Child Form is loaded
    By trinhtin in forum C# Programming
    Replies: 5
    Last Post: 09-11-2009, 09:49 PM
  5. windows.form.treeview control question
    By hoser2001 in forum C# Programming
    Replies: 11
    Last Post: 07-13-2006, 10:35 AM

Tags for this Thread

Bookmarks

Posting Permissions

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