473,385 Members | 1,764 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How can I design this approach ?

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
Nov 21 '05 #1
4 1381
//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

Nov 21 '05 #2
Thanks OHM, but ... Private MyParentFormValue As Form1
What is form1 ?? (myinvoice form ??)

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> ¦b¶l¥ó
news:%2****************@TK2MSFTNGP10.phx.gbl ¤¤¼¶¼g...
//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


Nov 21 '05 #3
Yes, thats just an example

--

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:Oa**************@TK2MSFTNGP12.phx.gbl...
Thanks OHM, but ... Private MyParentFormValue As Form1
What is form1 ?? (myinvoice form ??)

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> ¦b¶l¥ó
news:%2****************@TK2MSFTNGP10.phx.gbl ¤¤¼¶¼g...
//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



Nov 21 '05 #4
I completed this issue la.
thanks to OHM again ^_^

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> ¦b¶l¥ó
news:u8**************@tk2msftngp13.phx.gbl ¤¤¼¶¼g...
Yes, thats just an example

--

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:Oa**************@TK2MSFTNGP12.phx.gbl...
Thanks OHM, but ... Private MyParentFormValue As Form1
What is form1 ?? (myinvoice form ??)

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> ¦b¶l¥ó
news:%2****************@TK2MSFTNGP10.phx.gbl ¤¤¼¶¼g...
//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
>
>



Nov 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: John | last post by:
I'm developing an application for medical use that will be used to capture patient background and visit data. The application will have approximately 50 forms, with an average of about 20 fields...
3
by: Omer van Kloeten | last post by:
The Top Level Design: The class Base is a factory class with a twist. It uses the Assembly/Type classes to extract all types that inherit from it and add them to the list of types that inherit...
25
by: John Morgan | last post by:
Though I have designed and implemented a number of large reasonably well received web sites I do not consider myself a graphics designer I am now for the first time going to work with a ...
17
by: tshad | last post by:
Many (if not most) have said that code-behind is best if working in teams - which does seem logical. How do you deal with the flow of the work? I have someone who is good at designing, but...
10
by: charlie | last post by:
I posted this at Macromedia Dreamweaver newsgroup but go no response. I've been trying to learn CSS. Below is a link to a couple of designs that I managed to do using absolute position. ...
0
by: YellowFin Announcements | last post by:
Introduction Usability and relevance have been identified as the major factors preventing mass adoption of Business Intelligence applications. What we have today are traditional BI tools that...
17
by: roN | last post by:
Hi, I'm creating a Website with divs and i do have some troubles, to make it looking the same way in Firefox and IE (tested with IE7). I checked it with the e3c validator and it says: " This...
3
by: Mousam | last post by:
Hi All, First of all forgive me for the length of this post. I am developing one library for some text editor. In this library I want to provide a set of C++ classes which will enable client (of...
20
by: mike3 | last post by:
Hi. (Xposted to both comp.lang.c++ and comp.programming since I've got questions related to both C++ language and general programming) I've got the following C++ code. The first routine runs in...
0
by: jsimone | last post by:
This question is about DB2 table design and performance. We are using DB2 UDB Enterprise 8.2 on Linux. We have 6 tables in a parent-child (one-to-many) relationship with each other. Each...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.