.NET

Reply
Active Member
ElephantQi
Posts: 6
Registered: ‎04-19-2011
Message 1 of 3 (145 Views)
Accepted Solution

Window Jump!

145 Views, 2 Replies
04-27-2011 08:14 AM

Hello,

 

I use VB.NET design 4 windows for user input in AutoCad, when I hit the next button on the 1st window, then the 2nd window jump out, however, it jumps out behind the Autocad main window. the window 3 and 4 works fine. Is there anyone knows how to fix this little BUG?

 

Thank you in advanced!

 

I use VS2010 and AutoCad2011

 

I use the following to get the 1st window.

 

<CommandMethod("CoreInput")> _

Public Sub ShowForm()
        Dim ModalForm As Form1 = New Form1()
        Autodesk.AutoCAD.ApplicationServices.Application.ShowModalDialog(ModalForm)
    End Sub

-------------------------------------------------------------

use the following to hide the 1st window and jump out the 2nd window.

 

Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim Form2Open As New Form2
        Form2Open.Show()
        'Form2.Show()
        Me.Hide()
    End Sub

 

 

 

Why you do not use the Aplication.ShowModalDialog method on your Button_Click event as you did on your Command method?  You are not supposed to call the Form.Show methods directly because it could result in unexpected behavior.

Distinguished Contributor
HJohn1
Posts: 170
Registered: ‎09-26-2008
Message 2 of 3 (139 Views)

Re: Window Jump!

04-27-2011 10:00 AM in reply to: ElephantQi

Why you do not use the Aplication.ShowModalDialog method on your Button_Click event as you did on your Command method?  You are not supposed to call the Form.Show methods directly because it could result in unexpected behavior.

Active Member
ElephantQi
Posts: 6
Registered: ‎04-19-2011
Message 3 of 3 (133 Views)

Re: Window Jump!

04-27-2011 10:23 AM in reply to: HJohn1

It fixed, thanks John!:smileywink:

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!