fonts at runtime

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • elwaly

    #1

    fonts at runtime

    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

  • Herfried K. Wagner [MVP]

    #2
    Re: fonts at runtime

    "elwaly" <elmoizwaly@mob ifree.net> schrieb:[color=blue]
    > 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[/color]

    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.DialogRes ult.OK Then
    Me.Label1.Font = Me.FontDialog1. Font
    End If
    ///

    In the design view, select the label control and choose
    '(ApplicationSe ttings)' from the "Data" section". Choose
    '(PropertyBindi ng)' 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.

    --
    M S Herfried K. Wagner
    M V P <URL:http://dotnet.mvps.org/>
    V B <URL:http://classicvb.org/petition/>

    Comment

    • elwaly

      #3
      Re: fonts at runtime

      thank you very much Herfried,
      that code is exactlly what I am looking for.
      thanks again.

      Comment

      Working...