Link to home
Start Free TrialLog in
Avatar of thenrich
thenrich

asked on

New Form

How do I generate a new form at runtime in an ActiveX contol?
Avatar of Richie_Simonetti
Richie_Simonetti
Flag of Argentina image

if i remember well you need a form already in you project to do that.
Avatar of thenrich
thenrich

ASKER

no way to do it then ??
How can I display a modeless message from a control?
Private Sub Command1_Click()
    Dim Form2 As New Form1
    Form2.Show
End Sub
msgbox "hello"
Crash2100, I don't have a Form1 to start with.
I'm trying to do this:


Private Sub Command1_Click()
   Dim Form2 As Form
   Set Form2 = New Form
End Sub
Crash2100,

msgbox "hello"
is quite modal
msgbox is not modeless. is it necessary a form?, could'nt be other control instead (a picture box in example)?
If you need a very basic window, you may achieve what you need via API:

http://www.shrinkwrapvb.com/createw.htm
Can't you just create the form in your project at design time, then modify the message and whatever else you want at run time, then display it modelessly?

Zaphod.
what is modeless?
vbmodeless means no modal, which is the behaviour of a window that indicates that you could continue working with other windows in the application. Just remeber that msgbox are modal, until you close it, you can't do anything else with the app that shows one of them.
Ok let's try this .....
how bout some message boxes with timer's. Sites, ideas, etc.

Baiscally what I'm doing is creating a control that allows me to shut down an application on a server. The Control works just fine except for 1 sticky point. If I display a messagebox saying that the application will close in 30 seconds, the user must first hit the ok button to instantiate the timer. If I instantiate the timer before the messagebox it still waits for a response from the messagebox.

ASKER CERTIFIED SOLUTION
Avatar of Richie_Simonetti
Richie_Simonetti
Flag of Argentina image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I think I can do something with 1 of these examples.

thx
I think I can do something with 1 of these examples.

thx
Thanks for "A" grade. Did you forgive me for my first contact with you?
Cheers.
I'll let it slide ........... Just this once! thx for the help.
No, no, i was talking about VERY first one! You gave me my first experts points for a very bad ANSWER...
;)