ObjTag question

77 views
Skip to first unread message

James Lorimor

unread,
Jan 24, 2011, 5:27:18 PM1/24/11
to MetaDraw Developers Group
I'm starting out with a simple drawing program. panLine is a panel
with the controls for drawing lines, which is the first thing I
started with. When I run the program and click on the MetaDraw
control to draw a line, I get the error: Invalid object handle in the
"Current" property. The error is in the ObjTag line. If I comment
that line out, it will draw a line with the right width, color, style,
etc.

Private Sub mdrMap_MouseDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles mdrMap.MouseDown
Select Case mdrMap.EditMode
' If line mode is enabled...
Case BTIS.MetaDraw.EditMode.Line
' Set the current line to add using the attributes on
panLine
mdrMap.Current = BTIS.MetaDraw.ObjHandle.CurrAttr
mdrMap.LineColor = txtLineColor.BackColor
mdrMap.LineWidth = CInt(txtLineWidth.Text)
mdrMap.LineStyle =
CType(CInt(cmbLineStyle.SelectedIndex), BTIS.MetaDraw.LineStyle)
mdrMap.ObjTag() = cmbLineLayer.Text

End Select
End Sub

I've tried several things and can't get it to work. Any ideas?

James

Bennet-Tec Staff

unread,
Jul 19, 2012, 1:00:45 PM7/19/12
to metadraw-for...@googlegroups.com
The problem is the ObjTag property can only be set for actual
objects ( shapes, text, images ) already added to the drawing.
You can not set an  ObjTag value as a default   
       ( with .Current  = BTIS.MetaDraw.ObjHandle.CurrAttr )
When setting ObjTag the value of Current must point to such an object
     ( ie it must be great than BTIS.MetaDraw.ObjHandle.Valid )
 
Note - this question has been answered by Bennet-Tec Support.
Please be aware that we do not normally review this forum.
The MetaDraw Developers Group forum is intended for User to User
communication only.   For support from Bennet-Te please post
using the Bennet-Tec web site:
         www.Bennet-Tec.com
         =>  Click on Support
         =>  Click on "Submit Support Question
================================      
=============================
Reply all
Reply to author
Forward
0 new messages