Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15157

[RESOLVED] Drawing a line / rectangle on a form

$
0
0
I have a form on which is a frame in in that is an image. On this image I have drawn a number of labels (a cross and some text). I would also like to draw some horizontal & vertical lines. I think I draw these using rectangles with width/height of 1.

The code to draw the labels is:
Code:

Private Sub SetLabel(MyFrame As Frame, Mytop As Single, MyLeft As Single, MyCaption As String)
  Dim lblBox_n As Object
 
  Set lblBox_n = MyFrame.Controls.Add("Forms.Label.1", "lblBox_n", True)
  With lblBox_n
        .top = Mytop
        .left = MyLeft
        .caption = MyCaption
        .height = 8
        .width = 28
        .TextAlign = 1 ' left
        .ForeColor = vbRed
        .AutoSize = True
    End With
End Sub

Can you suggest similar code to draw a rectangle?

Thank you

Viewing all articles
Browse latest Browse all 15157

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>