.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
handling events from dll
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
56 Views, 0 Replies
07-26-2005 11:11 AM
im developing a NET dll working as COM (using usual autocad library, not managed code cos it must work on acad2004)
i have writte code to let user change active document selecting its name from a combobox list
[CODE]
xAcad = GetObject(, "AutoCAD.Application.16")
ThisDrawing = xAcad.ActiveDocument
Dim drawing As AcadDocument
For Each drawing In ThisDrawing.Application.Documents
ComboBoxDibujos.Items.Add(drawing.Name)
Next drawing
ComboBoxDibujos.SelectedText = ThisDrawing.Name
sDocumentoActivo = ThisDrawing.Name
....
Private Sub ButtonCambiarDibujo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonCambiarDibujo.Click
ThisDrawing = xAcad.Application.Documents.Item(sDocumentoActivar )
ThisDrawing.Application.Documents.Item(sDocumentoA ctivar).Activate()
sDocumentoActivo = ThisDrawing.Name
End Sub
Private Sub ComboBoxDibujos_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBoxDibujos.SelectedIndexChanged
sDocumentoActivar = ComboBoxDibujos.Text
End Sub
[/CODE]
but, lets suppose the user add or close a drawing, so i must catch this event and reset and fill again the combobox items list
how could i do this? anyone have tried?
thanks in advance
i have writte code to let user change active document selecting its name from a combobox list
[CODE]
xAcad = GetObject(, "AutoCAD.Application.16")
ThisDrawing = xAcad.ActiveDocument
Dim drawing As AcadDocument
For Each drawing In ThisDrawing.Application.Documents
ComboBoxDibujos.Items.Add(drawing.Name)
Next drawing
ComboBoxDibujos.SelectedText = ThisDrawing.Name
sDocumentoActivo = ThisDrawing.Name
....
Private Sub ButtonCambiarDibujo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonCambiarDibujo.Click
ThisDrawing = xAcad.Application.Documents.Item(sDocumentoActivar
ThisDrawing.Application.Documents.Item(sDocumentoA
sDocumentoActivo = ThisDrawing.Name
End Sub
Private Sub ComboBoxDibujos_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBoxDibujos.SelectedIndexChanged
sDocumentoActivar = ComboBoxDibujos.Text
End Sub
[/CODE]
but, lets suppose the user add or close a drawing, so i must catch this event and reset and fill again the combobox items list
how could i do this? anyone have tried?
thanks in advance

