Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

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

combobox

  • Please log in to reply
1 reply to this topic

#1 yasinirshad

yasinirshad

    CC Lurker

  • Just Joined
  • Pip
  • 3 posts

Posted 19 November 2007 - 05:08 AM

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.
  • 0

#2 TcM

TcM

    CC Mentor

  • VIP Member
  • PipPipPipPipPipPipPipPip
  • 7563 posts

Posted 19 November 2007 - 09:42 AM

Simple, just add this code in the child form

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.
  • 0





Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download