|
-
Dec 17th, 2001, 05:00 PM
#1
Label problem
Here is the code :
VB Code:
label1.caption = "This is my number : " & VARIABLE1 & "/" & Variable2
How can i have only the variable1 in bold ?
-
Dec 17th, 2001, 05:09 PM
#2
Hyperactive Member
You could creat a second label with autosize and bold, fill it with variable one, and zorder it to the front over part of label one. Then instead of
label1.caption = "This is my number : " & VARIABLE1 & "/" & Variable2
say
label1.caption = "This is my number : " & Space(Len(label2.caption) +1) & "/" & Variable2
move label2 to be just right of "number" in label1.
-
Dec 17th, 2001, 05:11 PM
#3
... well that so evil way ...
-
Dec 17th, 2001, 05:17 PM
#4
Hyperactive Member
You could also try:
-finding another control that you could use ie. a rich text box disabled with no border and set to be grey, that might work
-finding a way to get the width of a letter on the screen so that you can programmatically set the spacing better.
-
Dec 17th, 2001, 05:38 PM
#5
-
Dec 18th, 2001, 02:26 AM
#6
PowerPoster
Hi Daok
Why not just print your 'label' directly to the form
This may appear to be long code but you could set up a sub to handle all of the formatting and just call for each new label that needs diff internal formats.
Regards
Stuart
VB Code:
Private Sub Command1_Click()
Dim Variable1 As Long
Dim Variable2 As Long
Variable1 = 200
Variable2 = 350
'Print to Picture box or form
With Me
.CurrentX = 400
.CurrentY = 400
.FontBold = False
Me.Print "This is my number : ";
.FontBold = True
Me.Print Variable1;
.FontBold = False
Me.Print " / " & Variable2
End With
End Sub
Private Sub Command2_Click()
'You can work out x,y specifics more exactly for your
'fake label
Me.Line (400, 400)-(3200, 800), vbButtonFace, BF 'Erase the label before reprint
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|