.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Options Tab Dialog Box Problem

3 REPLIES 3
Reply
Message 1 of 4
DavidScott
414 Views, 3 Replies

Options Tab Dialog Box Problem

I've created an additional tab in the standard options dialog. This works fine, however I am having trouble opening a dialog box from the tab. I'm usign the following code:

Dim frm1 As diag_Printers = New diag_Printers

Application.ShowModalDialog(frm1)

When I use this code with CommandMethod it works fine. When I try and run it from clicking a button on my new options tab AutoCAD crashes. The form does appear, however it is blank and doesn't respond.

Any solutions to this or am I not able to open a dialog from the options. Message was edited by: DavidScott
3 REPLIES 3
Message 2 of 4
ahmed.felix
in reply to: DavidScott

Dim frm1 As diag_Printers = New diag_Printers
frm1.ShowDialog()

Application.ShowModalDialog will work if used from AutoCAD (as in the Command), you are trying to show it from inside your application.
Message 3 of 4
Anonymous
in reply to: DavidScott

I have no problem displaying a modal form from a control on a tab on the options dialog (I only tried that in AutoCAD 2009 however, can't vouch for what happens in earlier releases).

So, I suppose that the problem may have something to do with your form and what it is doing when you show it.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000 through 2009

http://www.acadxtabs.com

Introducing AcadXTabs 2010:
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm

wrote in message news:5986305@discussion.autodesk.com...
I've created an additional tab in the standard options dialog. This works fine, however I am having trouble opening a dialog box from the tab. I'm usign the following code:

Dim frm1 As diag_Printers = New diag_Printers

Application.ShowModalDialog(frm1)

When I use this code with CommandMethod it works fine. When I try and run it from clicking a button on my new options tab AutoCAD crashes. The form does appear, however it is blank and doesn't respond.

Any solutions to this or am I not able to open a dialog from the options.

Message was edited by: DavidScott
Message 4 of 4
pierre.plaissy
in reply to: DavidScott

I have the same problem when I try to show a color dialog (Autocad or Windows), in 2008 and 2009.
I tried many ways. Same results.
The replies from Ahmed and Tony didn't help me.
Any more clue ?

This doesn't work :

Private Sub btnCoulCentre_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCoulCentre.Click
Dim dlg As New Autodesk.AutoCAD.Windows.ColorDialog
dlg.Color = Autodesk.AutoCAD.Colors.Color.FromColor(btnCoulCentre.BackColor)
dlg.SetDialogTabs(Autodesk.AutoCAD.Windows.ColorDialog.ColorTabs.ACITab)
Dim dr As System.Windows.Forms.DialogResult
dr = dlg.ShowDialog
If dr = Windows.Forms.DialogResult.OK Then
btnCoulCentre.BackColor = dlg.Color.ColorValue
End If
End Sub

btnCoulCentre is a button control in a System.Windows.Forms.UserControl used to display a new option tab in Autocad options form.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost