PDA

View Full Version : VB USERFORM Usage


muckmail
13-03-2007, 12:03 PM
Subject: Can a person minimize a userform window and continue to use AutoCAD with stopping a CAD VBA program ? CAD version 07

If is use
Private Sub CommandButton4_Click()
'UserForm1.Left = 240
'UserForm1.Top = 330
UserForm1.hide
End Sub

This will stop my program and put me in code window. I would like to only minimize my VB userform and use cad for short period of time then maximize my window for vba program usage. Is that possable?
thank you,



muck
View Public Profile
Send a private message to muck
Find More Posts by muck

Paul_Cadtastic
13-03-2007, 07:56 PM
Yes it is possible.

The best way to do it is to open the form but make the form non modal.

I have a form that when you click fix in auto cad, it launches another form with a button called return to icheck. This form is modal set to false and therefore lets the user continue working in CAD until they wish to relaunch the main form.

The form property is Showmodal and it should be set to false. If you get stuck, look at help on this function and the example should show you how to deal with it!

I hope it helps.

Gms
23-07-2007, 10:49 AM
Create a button CmdModal and add this code;

Private Sub CmdModal_Click()
If CmdModal.Caption = "Modeless" Then
CmdModal.Caption = "Modal"
Me.Hide
Me.Show vbModless
ElseIf CmdModal.Caption = "Modal" Then
CmdModal.Caption = "Modeless"
Me.Hide
Me.Show vbModal
End If
End Sub

and you can toggle between Modal end Modeless form