Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using a form twice in a program

Status
Not open for further replies.

ShaneBrennan

Programmer
May 19, 1999
198
0
0
GB
I designed a simple form to hold notes on a task I have to do, similar to a program called sticky notes. However I have a little problem. I can only display the form once.

What I would like to have is lots of these notes on my screen - because I have a rather lot to do :(

Anyways, has anyone got any suggestions that could help me.

It would be nice if you could have an array of forms, like you can have an array of objects on a forms.

Shane Shane Brennan

'-----------------------

' Emails: shanebrennan@postmaster.co.uk
' Personal WebPage:
 
Dear Shane Brennan

Try this...

Create a form name it form1 which may contain a text box to which u write ur notes and another one form2, add a command button on form2 name it cmdStickNote in the click event write this

dim frm as new form1
frm.show


so every time u click the cmdStickyNote button it load a new instance of the form1.

Hope this helps


Regards
Mahesh
 
Thanks mshetti

That worked a treat, but how can I distinguish one form from another, because with the dim won't a) the variable be destroyed once the event ends & b) it is not an array?

Shane Shane Brennan

'-----------------------

' Emails: shanebrennan@postmaster.co.uk
' Personal WebPage:
 
Okay Say I have 3 instances of a form called frmMemo which has a textbox called txtDescription.

Could I write a simple piece of code that would display the contents of this textbox to the screen (using a msgbox)?

Shane Brennan

'-----------------------

' Emails: shanebrennan@postmaster.co.uk
' Personal WebPage:
 
Dear Shane Brennan

Try this...

loop thru the forms collection

for each frm in forms
if typeof frm is form1 then
msgbox frm.text1.text
end if
next

Hope this helps

Regards
Mahesh
mshetti@yahoo.com
 
Does each of these instances of the form have a unique identifier & can I use this number to set the focus to a specific form? Shane Brennan

'-----------------------

' Emails: shanebrennan@postmaster.co.uk
' Personal WebPage:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top