fonts at runtime

  • Thread starter Thread starter elwaly
  • Start date Start date
E

elwaly

hi there
any one to tell me how to change a textbox font at run time
perminantlly so that the user can set the textbox's font one time and
rerun the application without change in the font he set (the user set
the textbox's font as his default font) assuming that the application
uses the microsoft's common font dialog box and the textbox is indexed
in an array
thank you
 
elwaly said:
any one to tell me how to change a textbox font at run time
perminantlly so that the user can set the textbox's font one time and
rerun the application without change in the font he set (the user set
the textbox's font as his default font) assuming that the application
uses the microsoft's common font dialog box and the textbox is indexed
in an array

If you are using .NET 2.0:

Add a label onto the form. Then add a fontdialog component and a button
control. Place the code below in the button's 'Click' event handler:

\\\
If Me.FontDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
Me.Label1.Font = Me.FontDialog1.Font
End If
///

In the design view, select the label control and choose
'(ApplicationSettings)' from the "Data" section". Choose
'(PropertyBinding)' there and press the "..." button. Then select the
'Font' property in the application settings dialog and add an application
setting by selecting "New..." from the combobox on the right side of the
'Font' property in the grid. No additional code is required.
 
thank you very much Herfried,
that code is exactlly what I am looking for.
thanks again.
 
Back
Top