button in bold

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

    button in bold

    Hello peole,

    i'm begin with VB.NET (before i was under ASP and VB)

    i have a -CheckBox- turned into a button with him properties Appearance.

    so i whant that the text become in Bold so i have Write This ->

    checkbox1.Font = New Font(checkbox1. Text, chkdef.Text)

    But that dont work :-( so how i can simply turn the texte into BOLD ?

    Thank a lot people....


  • Herfried K. Wagner [MVP]

    #2
    Re: button in bold

    "James_Ptg" <Twinsen24@hotm ail.Com> schrieb:[color=blue]
    > checkbox1.Font = New Font(checkbox1. Text, chkdef.Text)
    >
    > But that dont work :-( so how i can simply turn the texte into BOLD ?[/color]

    \\\
    Me.Button1.Font = _
    New Font(Me.Button1 .Font, Me.Button1.Font .Style Or FontStyle.Bold)
    ///

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

    Comment

    • james

      #3
      Re: button in bold


      "James_Ptg" <Twinsen24@hotm ail.Com> wrote in message
      news:uWkC%23Q8O GHA.740@TK2MSFT NGP12.phx.gbl.. .[color=blue]
      > Hello peole,
      >
      > i'm begin with VB.NET (before i was under ASP and VB)
      >
      > i have a -CheckBox- turned into a button with him properties Appearance.
      >
      > so i whant that the text become in Bold so i have Write This ->
      >
      > checkbox1.Font = New Font(checkbox1. Text, chkdef.Text)
      >
      > But that dont work :-( so how i can simply turn the texte into BOLD ?
      >
      > Thank a lot people....[/color]

      Here is a simple example:

      Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
      System.EventArg s) Handles Button1.Click


      With CheckBox1

      .Text = "I'm BOLD"

      .Font = New System.Drawing. Font("Arial", 10)

      .Font = New System.Drawing. Font(CheckBox1. Font, FontStyle.Bold)

      End With

      End Sub



      It's buried in the help (well, for me it was) Hope this helps.

      james







      Comment

      • Galen Somerville

        #4
        Re: button in bold


        "james" <jjames700REMOV EME@earthlink.n et> wrote in message
        news:ui1Qq%238O GHA.2828@TK2MSF TNGP12.phx.gbl. ..[color=blue]
        >
        > "James_Ptg" <Twinsen24@hotm ail.Com> wrote in message
        > news:uWkC%23Q8O GHA.740@TK2MSFT NGP12.phx.gbl.. .[color=green]
        >> Hello peole,
        >>
        >> i'm begin with VB.NET (before i was under ASP and VB)
        >>
        >> i have a -CheckBox- turned into a button with him properties Appearance.
        >>
        >> so i whant that the text become in Bold so i have Write This ->
        >>
        >> checkbox1.Font = New Font(checkbox1. Text, chkdef.Text)
        >>
        >> But that dont work :-( so how i can simply turn the texte into BOLD ?
        >>
        >> Thank a lot people....[/color]
        >
        > Here is a simple example:
        >
        > Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
        > System.EventArg s) Handles Button1.Click
        >
        >
        > With CheckBox1
        >
        > .Text = "I'm BOLD"
        >
        > .Font = New System.Drawing. Font("Arial", 10)
        >
        > .Font = New System.Drawing. Font(CheckBox1. Font, FontStyle.Bold)
        >
        > End With
        >
        > End Sub
        >
        >
        >
        > It's buried in the help (well, for me it was) Hope this helps.
        >
        > james
        >
        >[/color]
        I would have said "buried deep in the help"

        GalenS


        Comment

        • james

          #5
          Re: button in bold


          "Galen Somerville" <galen@communit y.nospam> wrote in message
          news:u6OQw99OGH A.2604@TK2MSFTN GP09.phx.gbl...[color=blue]
          >
          > "james" <jjames700REMOV EME@earthlink.n et> wrote in message
          > news:ui1Qq%238O GHA.2828@TK2MSF TNGP12.phx.gbl. ..[color=green]
          >> Here is a simple example:
          >>
          >> Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
          >> System.EventArg s) Handles Button1.Click
          >>
          >>
          >> With CheckBox1
          >>
          >> .Text = "I'm BOLD"
          >>
          >> .Font = New System.Drawing. Font("Arial", 10)
          >>
          >> .Font = New System.Drawing. Font(CheckBox1. Font, FontStyle.Bold)
          >>
          >> End With
          >>
          >> End Sub
          >>
          >>
          >>
          >> It's buried in the help (well, for me it was) Hope this helps.
          >>
          >> james
          >>
          >>[/color]
          > I would have said "buried deep in the help"
          >
          > GalenS
          >[/color]


          Yes, that is probably a more accurate description ! :-)

          james


          Comment

          • james

            #6
            Re: button in bold

            Just to make it more fun,,,,,,,,,,,, here's this:

            Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
            System.EventArg s) Handles Button1.Click

            With CheckBox1

            ..Text = "I'm BOLD"

            ..Font = New System.Drawing. Font(CheckBox1. Font, FontStyle.Under line +
            FontStyle.Bold + FontStyle.Itali c + FontStyle.Strik eout)

            End With

            End Sub



            Almost all the available settings except for FontStyle.Regul ar.
            james



            Comment

            Working...