.NET
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
*Vassil
How to respond to a click on Autodesk.A utoCAD.Win dows.Pane ?
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
204 Views, 7 Replies
10-11-2007 06:48 AM
Hello !
I'm new to vb.net (moving from VBA) so please excuse me if this sounds
stupid... I'm adding a pane to the status bar an I want to show a popup menu
(or execute a command) after clicking on the pane. This is my code :
Dim DetPane As New Autodesk.AutoCAD.Windows.Pane
DetPane.Text = "DE : "
DetPane.MinimumWidth = 30
DetPane.ToolTipText = "Current Detail : "
DetPane.Enabled = True
DetPane.Visible = True
DetPane.Style = Autodesk.AutoCAD.Windows.PaneStyles.PopUp
Application.StatusBar.Panes.Add(DetPane)
Please, let me know how to create the callback function. Thanks in advance !
I'm new to vb.net (moving from VBA) so please excuse me if this sounds
stupid... I'm adding a pane to the status bar an I want to show a popup menu
(or execute a command) after clicking on the pane. This is my code :
Dim DetPane As New Autodesk.AutoCAD.Windows.Pane
DetPane.Text = "DE : "
DetPane.MinimumWidth = 30
DetPane.ToolTipText = "Current Detail : "
DetPane.Enabled = True
DetPane.Visible = True
DetPane.Style = Autodesk.AutoCAD.Windows.PaneStyles.PopUp
Application.StatusBar.Panes.Add(DetPane)
Please, let me know how to create the callback function. Thanks in advance !
Re: How to respond to a click on Autodesk.A utoCAD.Win dows.Pane ?
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
10-11-2007 01:07 PM in reply to:
*Vassil
I am not sure how to hook events in VB, I use mostly use C# for customizing AutoCAD 2008. Looking in the VS object browser a 'Pane' object is derived from 'StatusBarItem' which has a 'MouseDown' event that you can hook into.
The event handler would have this similar signature:
Autodesk.AutoCAD.Windows.StatusBarMouseDownEventHa ndler.StatusBarMouseDownEventHandler(void (object, Autodesk.AutoCAD.Windows.StatusBarMouseDownEventAr gs))
I have very limited experience with VB NET so I can't show you how you would wire it up.
The event handler would have this similar signature:
Autodesk.AutoCAD.Windows.StatusBarMouseDownEventHa
I have very limited experience with VB NET so I can't show you how you would wire it up.
*Vassil
WOW ! I'm happy !
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
10-12-2007 02:23 AM in reply to:
*Vassil
Thanks alot !
This is the code and it is working
:
................
AddHandler DetPane.MouseDown, AddressOf OnPaneMouseDown
.................
Sub OnPaneMouseDown(ByVal o As Object, ByVal e As
StatusBarMouseDownEventArgs)
Application.DocumentManager.MdiActiveDocument.Edit or.WriteMessage(vbNewLine
+ "Do something man !" + vbNewLine)
End Sub
This is the code and it is working
................
AddHandler DetPane.MouseDown, AddressOf OnPaneMouseDown
.................
Sub OnPaneMouseDown(ByVal o As Object, ByVal e As
StatusBarMouseDownEventArgs)
Application.DocumentManager.MdiActiveDocument.Edit
+ "Do something man !" + vbNewLine)
End Sub
Re: WOW ! I'm happy !
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
10-12-2007 06:37 AM in reply to:
*Vassil
That's great to hear! I am going to keep your sample for my possible future use! It gives me a good example of how to hook an event in VB.
Re: WOW ! I'm happy !
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-20-2012 08:12 AM in reply to:
*Vassil
Anyone figure out how to make this work in 2013? Pane.MouseDown does not seem to exist? Please help!!
Steve
Windows 7 Enterprise 64-bit SP1
Intel Core i7 CPU X920 @ 1.73 GHz
16.00 GB RAM
Civil 3D 2013 SP1 64-bit
Check out my AutoCAD, Civil 3D, and Map Apps on the Autodesk Exchange Store at: Autodesk Exchange Store or Red Transit Consultants, LLC Website
Windows 7 Enterprise 64-bit SP1
Intel Core i7 CPU X920 @ 1.73 GHz
16.00 GB RAM
Civil 3D 2013 SP1 64-bit
Check out my AutoCAD, Civil 3D, and Map Apps on the Autodesk Exchange Store at: Autodesk Exchange Store or Red Transit Consultants, LLC Website
Re: WOW ! I'm happy !
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-20-2012 08:33 AM in reply to:
stevenh0616
Re: WOW ! I'm happy !
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-20-2012 09:49 AM in reply to:
Alexander.Rivilis
Well I see that it's there under StatusBarItem, but it gives an error under Pane....
If I Have code like this
Dim DetPane As New Autodesk.AutoCAD.Windows.Pane DetPane.Text = "DE : " DetPane.MinimumWidth = 30 DetPane.ToolTipText = "Current Detail : " DetPane.Enabled = True DetPane.Visible = True DetPane.Style = Autodesk.AutoCAD.Windows.PaneStyles.PopUp DetPane.MouseDown += New StatusBarMouseDownEventHandler(AddressOf OnAppMouseDown) Application.StatusBar.Panes.Add(DetPane)
I get this... Could I be missing an Import??
Here are my imports...
Imports Autodesk.AutoCAD.Runtime Imports Autodesk.AutoCAD.ApplicationServices Imports cadApp = Autodesk.AutoCAD.ApplicationServices.Application Imports cadDocExt = Autodesk.AutoCAD.ApplicationServices.DocumentExtension Imports Autodesk.AutoCAD.Windows
Steve
Windows 7 Enterprise 64-bit SP1
Intel Core i7 CPU X920 @ 1.73 GHz
16.00 GB RAM
Civil 3D 2013 SP1 64-bit
Check out my AutoCAD, Civil 3D, and Map Apps on the Autodesk Exchange Store at: Autodesk Exchange Store or Red Transit Consultants, LLC Website
Windows 7 Enterprise 64-bit SP1
Intel Core i7 CPU X920 @ 1.73 GHz
16.00 GB RAM
Civil 3D 2013 SP1 64-bit
Check out my AutoCAD, Civil 3D, and Map Apps on the Autodesk Exchange Store at: Autodesk Exchange Store or Red Transit Consultants, LLC Website
Re: WOW ! I'm happy !
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-20-2012 11:26 AM in reply to:
stevenh0616
Sub OnPaneMouseDown(ByVal o As Object, ByVal e As StatusBarMouseDownEventArgs)
Application.DocumentManager.MdiActiveDocument.Edit or.WriteMessage(vbNewLine + "Do something man !" + vbNewLine)
End Sub
<CommandMethod("MyCommand")> _
Public Sub MyCommand() ' This method can have any name
Dim DetPane As New Autodesk.AutoCAD.Windows.Pane
DetPane.Text = "DE : "
DetPane.MinimumWidth = 30
DetPane.ToolTipText = "Current Detail : "
DetPane.Enabled = True
DetPane.Visible = True
DetPane.Style = Autodesk.AutoCAD.Windows.PaneStyles.PopUp
AddHandler DetPane.MouseDown, AddressOf OnPaneMouseDown
Application.StatusBar.Panes.Add(DetPane)
End Sub



