From: Harry Strybos on 1 Jun 2010 16:22 "Robbie" <robc1(a)yahoo.com> wrote in message news:goydnZMe_sAL8JnRnZ2dnUVZ_qidnZ2d(a)giganews.com... > Hi, > > I have a "keyboard" form that I would like to reuse through out my > application... > > Let's say in Form1 I have a text box or property I want to populate... I > want to be able to call the "FormKeyboard" which has a textbox that gets > populated with the value typed by the user. I then want to transfer this > value back to the Calling Form... > > How may I make "FormKeyboard" generic enough to be useable form any form ? > > Thanks > Put a public property on your FormKeyboard called eg MyTextValue Put a constructor on FormKeyboard Public Sub New (sMyTextValue as String) Me.MyTextValue = sMyTextValue 'here you pass whatever value to the form End Sub When calling FormKeyboard do it modally eg Using frm as New FormKeyBoard(Text1.text) With frm .ShowDialog(Me) 'here you can get back the value Text1.Text = .MyTextValue End With End Using
From: Robbie on 2 Jun 2010 22:27
Thank you - I will try this out... "Harry Strybos" <nospam(a)ffapaysmart.com.au> wrote in message news:OIP86gcALHA.3176(a)TK2MSFTNGP05.phx.gbl... > "Robbie" <robc1(a)yahoo.com> wrote in message > news:goydnZMe_sAL8JnRnZ2dnUVZ_qidnZ2d(a)giganews.com... >> Hi, >> >> I have a "keyboard" form that I would like to reuse through out my >> application... >> >> Let's say in Form1 I have a text box or property I want to populate... I >> want to be able to call the "FormKeyboard" which has a textbox that gets >> populated with the value typed by the user. I then want to transfer >> this value back to the Calling Form... >> >> How may I make "FormKeyboard" generic enough to be useable form any form >> ? >> >> Thanks >> > Put a public property on your FormKeyboard called eg MyTextValue > > Put a constructor on FormKeyboard > > Public Sub New (sMyTextValue as String) > Me.MyTextValue = sMyTextValue 'here you pass whatever value to the form > End Sub > > When calling FormKeyboard do it modally eg > > Using frm as New FormKeyBoard(Text1.text) > With frm > .ShowDialog(Me) > 'here you can get back the value > Text1.Text = .MyTextValue > End With > End Using > > > > > |