//Search Form
Public Class Search
Inherits System.Windows.Forms.Form
Private MyParentFormValue As Form1
Public Property MyParentForm() As Form1
Get
Return MyParentFormValue
End Get
Set(ByVal Value As Form1)
MyParentFormValue = Value
End Set
End Property
#Region " Windows Form Designer generated code "
Public Sub New(ByVal f As Form1)
MyBase.New()
Me.MyParentForm = f
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
'if 'MyParentForm.MySearchMethod( textbox1.text ) then
Me.DialogResult = System.Windows.Forms.DialogResult.OK
Me.Close()
'Else
TextBox1.Focus()
Label1.Text = "not Found"
'End if
End Sub
//Calling Form
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim f As New Search(Me)
f.ShowDialog()
End Sub
--
OHM ( Terry Burns )
. . . One-Handed-Man . . .
Time flies when you don't know what you're doing
"Agnes" <ag***@dynamictech.com.hk> wrote in message
news:OU**************@TK2MSFTNGP11.phx.gbl...
I got a invoice form , and toolbar, as the user click search button. I
want to prompt a little window with one textbox , "OK" button and "Cancel"
button.
as the user input the invoice_no, press OK , it will search the record .
if there is not record .(prompt the messagebox) and the focus will still keep
on the textbox.
Now. I got many forms which need to use this "little window" . BUT I don't
want to create these forms and "put" different codes in the "OK" button .
I would like to put all the codes in (invoice form) ,
How can I do this--->"as the user press the OK button in little window,
little window will call the invoiceform's method but not itself'
Does anyone understand my silly question ??
Thanks a lot