|
-
Jul 10th, 2003, 12:18 PM
#1
Thread Starter
Fanatic Member
Change font size by clicking on + or - buttons
How can I change the font size only of a label's text property by clicking on a button. Basically, I want two buttons. One to increase the size and one to decrease the size.
-
Jul 10th, 2003, 12:43 PM
#2
VB Code:
Dim x As Integer
Dim f As String
'///^^^ referenced so available from all controls.
'//////////
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
x = Label1.Font.Size
f = Label1.Font.Name
Label1.Font = New Drawing.Font(f, x + 1)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
x = Label1.Font.Size
f = Label1.Font.Name
Label1.Font = New Drawing.Font(f, x - 1)
End Sub
~
if a post is resolved, please mark it as [Resolved]
protected string get_Signature(){return Censored;}
[vbcode][php] please use code tags when posting any code [/php][/vbcode]
-
Jul 10th, 2003, 12:46 PM
#3
Addicted Member
to increase:
Label1.Font = New Font(Label1.Font.FontFamily, Label1.Font.Size + 1)
to decreace:
Label1.Font = New Font(Label1.Font.FontFamily, Label1.Font.Size - 1)
-
Jul 10th, 2003, 12:47 PM
#4
Addicted Member
-
Jul 10th, 2003, 12:55 PM
#5
lol , must have my finger on the trigger today
~
if a post is resolved, please mark it as [Resolved]
protected string get_Signature(){return Censored;}
[vbcode][php] please use code tags when posting any code [/php][/vbcode]
-
Jul 10th, 2003, 06:08 PM
#6
Thread Starter
Fanatic Member
Thanks!
Howdy Gunslingers!
Both responses are greatly appreciated!
Thanks!
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
|