set the bottom propertie of a label

Z

zz

i have this routine in a userform, what this does is generate a label for
each range in the "a" column in the activesheet, representing a 'bars
graph', this works fine, it show the 'bars' and the values into the bars,
but i don't like the way this get aligned, it looks like they're hanging
from the uppermost border of the containing frame , i'd like them to look
like a real graph with the bars 'pointing' upside, i've been playing with
the top property of the label but unfortunately doesn't work for me.

i would like to resemble the bottom property and align the labels in the
bottom of the frame

--------the sub---------

Private Sub create_graphic()
Dim i As Integer, r As Range
Frame1.Caption = "Month trends"
i = 1
Do Until Range("a" & i).Value = ""
Frame1.Controls.Add "forms.Label.1", "label" & i, True
Controls("label" & i).Height = Range("A" & i + 1).Value
Controls("label" & i).Width = 15
Controls("label" & i).BackColor = RGB(250, 120, 10)
Controls("label" & i).Left = i * 15
Controls("label" & i).ForeColor = RGB(250, 250, 250)
Controls("label" & i).Caption = Range("A" & i + 1).Value
Controls("label" & i).BorderStyle = 1
Controls("label" & i).BorderColor = RGB(255, 255, 255)
Controls("label" & i).Font.Bold = True
Controls("label" & i).Font.Size = 5
i = i + 1
Loop
End Sub


thanks in advantage
 
Z

zz

forget it, i added this line and is working now


Controls("label" & i).Top = Frame1.Top + Frame1.Height - Controls("label" &
i).Height

look like guadalupe-reyes still doing effect....

XD
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top