How to set font size of a control dynamically
-
Hi How can I set the font size of a control dynamically e.g. label. The problem is that the font size property is readonly. Thanks
reman
-
Hi How can I set the font size of a control dynamically e.g. label. The problem is that the font size property is readonly. Thanks
reman
you have to assign a new font to the font (not entirly shure) property: dim f as new font ("Arial",12,...) label.font = f hope this helps
If my help was helpfull let me know, if not let me know why. The only way we learn is by making mistakes.
-
Hi How can I set the font size of a control dynamically e.g. label. The problem is that the font size property is readonly. Thanks
reman
You can easily change the Font Size,Style,Family by using any of the following code:
Dim fdlg As New FontDialog() If fdlg.ShowDialog = DialogResult.OK Then Me.Label1.Font = fdlg.Font End If
Alternatively you can change the font by using this code:
Dim \_font As New Font("verdana", 24, FontStyle.Italic) Me.Label1.Font = \_font
Hope it helps. AliAmjad (MCP)
-
Hi How can I set the font size of a control dynamically e.g. label. The problem is that the font size property is readonly. Thanks
reman
please try following code for increase font size (Label) Me.Label1.Font = New System.Drawing.Font("arial", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label1.Size = New System.Drawing.Size(208, 24) Me.Label1.Text = "Label Font Size Change"
mitesh