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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open same form more than once

Status
Not open for further replies.

james0264

Programmer
Joined
Mar 1, 2005
Messages
52
Location
GB
I got a button that when clicked on will open a website in a small form of itself. However, after opening the form, all the button does after that is refresh the newly opened form. I wish to open the same form multiple times with just one button, each time the buttonis clicked, another instance of this form is opened. Please supply me with a solution, if possible but else please guide me through. Thanks. :D
 
Welcome to Tek-Tips. To get the best from these forums for computer professionals, read faq222-2244 carefully, especially paragraphs 8,9,10,15 & 16

Then do a search in VBHelp and on the forum for MDIChild

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first
'If we're supposed to work in Hex, why have we only got A fingers?'
Essex Steam UK for steam enthusiasts
 
Create your form that you want a number of, which in this code is called myForm.

In the button_click eent, place:

Dim newForm as New myForm

With newForm
'Place any form specific code here, such as title for the form, or textbox and labels.
.show
end with

BB
 
Errrm BiggerBrother, I don't get quite what you mean since I don't have fluent English. You said ...
'Place any form specific code here, such as title for the form, or textbox and labels.
.show
... but all I want for the button to do is open the form, what do I place in the "'Place any form specific code here, such as title for the form, or textbox and labels."? Thanks again but sorry for my poor English. :S
 
You don't have to do anything, but one thing that I recommend is to change the caption. That way, you will be able to refer back to that form (by looping thru the forms collection searching for .caption) You could also change the form name, but then you wouldn't be able to tell by looking at it.
 
You can give each instance a unique TAG property. SO the first time you load the form, give it a tag value of 1, and the next give it a value of 2. The you can refer to the form with the tag value of 1 or 2.

BB
 
That's not what I mean, sorry. My program will be minimsed on the system taskbar so the function keys will not be over riden. I need a code that can over ride the function keys even after minimisation. Sorry about the late reply, but thanks for any help.
 
Sorry, posted my reply in the wrong place, thanks for helping me anyway. My solution that I found out conincidently is:
Code:
Dim frmForm As New frmForm
Thanks again!
 
Which is surely what I wrote only 5 posts ago?

Glad I could help

BB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top