ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   set the bottom propertie of a label (https://www.excelbanter.com/excel-programming/380626-set-bottom-propertie-label.html)

zz

set the bottom propertie of a label
 
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

--
---
zz [MX]
cuasi-musico,semi-poeta y loco



zz

set the bottom propertie of a label
 
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
--
---
zz [MX]
cuasi-musico,semi-poeta y loco


"zz" wrote in message
...
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

--
---
zz [MX]
cuasi-musico,semi-poeta y loco





All times are GMT +1. The time now is 10:59 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com