HI Powell ,
Now i am able to draw rectangles on any particular control if i
click , but the thing is it is not able to recognize the
LineShape,RectangleShape,OvalShape which are from
VisualBasic.PowerPacks.Dll if click on those shapes ,but recognizing
controls of type Control
if i click a button on toolstrip it creates Rectangle
While creating like this on panel ::
Dim shc As ShapeContainer = New ShapeContainer()
shc.Location = New System.Drawing.Point(0, 0)
shc.Margin = New System.Windows.Forms.Padding(0)
shc.Name = "ShapeContainer1"
Rect = New RectangleShape(shc)
Rect.Location = New System.Drawing.Point(ihorizontal,
ivertical)
Rect.Size = New Size(70, 40)
Rect.Name = "RectangleShape1"
Rect.Enabled = False
CurrentPanel= SampleForm.Panel1.Controls("Page" &
CurrentPanelNo)
cs.WireControl(Rect) --- Used from CodePRoject PICKBOX
project --not working on shapes
CurrentPanel.Controls.Add(shc) --------------- Adding to
Current Panle
g = CurrentPanel.CreateGraphics
'AddHandler ctr.MouseDown, AddressOf Ctr_MouseDown
AddHandler Rect.MouseClick, AddressOf Ctr_MouseClick
'AddHandler ctr.MouseLeave, AddressOf Ctr_MouseLeave
'AddHandler ctr.MouseUp, AddressOf Ctr_MouseUp
while Ctr_MouseClick i am writing this thing to get handle around
that control
If TypeOf sender Is TextBox Then
ctr = DirectCast(sender, TextBox)
ControlPaint.DrawSelectionFrame(g, True, Rectangle.Inflate(Box,
boxsize, boxsize), Box, Color.DarkBlue)
ControlPaint.DrawGrabHandle(g, New Rectangle(ctr.Left - 6,
ctr.Top - 6, boxsize, boxsize), True, True)
ControlPaint.DrawGrabHandle(g, New Rectangle(ctr.Left +
ctr.Width / 2 - 6, ctr.Top - 6, boxsize, boxsize), True, True)
ControlPaint.DrawGrabHandle(g, New Rectangle(ctr.Left +
ctr.Width, ctr.Top - 6, boxsize, boxsize), True, True)
ControlPaint.DrawGrabHandle(g, New Rectangle(ctr.Left - 6,
ctr.Top + ctr.Height, boxsize, boxsize), True, True)
ControlPaint.DrawGrabHandle(g, New Rectangle(ctr.Left +
ctr.Width / 2 - 6, ctr.Top + ctr.Height, boxsize, boxsize), True,
True)
ControlPaint.DrawGrabHandle(g, New Rectangle(ctr.Left +
ctr.Width, ctr.Top + ctr.Height, boxsize, boxsize), True, True)
ElseIf TypeOf sender Is LineSelection Then ----- Not
Recognizing the click
Line = CType(sender, LineShape)
......
But not Working .........
Thanks & Regards ,
For1248