Upper Text in a TreeView

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

    Upper Text in a TreeView

    Hello,

    In a textbox it is possible set charapters to upper with this property :
    CharacterCasing = Upper

    In a treeView not is possible...

    In Vb i set in a Event form KeyPress --> keyascii =
    asc(ucase(chr(k eyascii)))

    in dotnet ?


  • Rothariger

    #2
    RE: Upper Text in a TreeView

    hi, i didnt understand anything...

    "Tony" wrote:
    [color=blue]
    > Hello,
    >
    > In a textbox it is possible set charapters to upper with this property :
    > CharacterCasing = Upper
    >
    > In a treeView not is possible...
    >
    > In Vb i set in a Event form KeyPress --> keyascii =
    > asc(ucase(chr(k eyascii)))
    >
    > in dotnet ?
    >
    >
    >[/color]

    Comment

    • Herfried K. Wagner [MVP]

      #3
      Re: Upper Text in a TreeView

      "Rothariger " <Rothariger@msn .com> schrieb:[color=blue]
      > hi, i didnt understand anything...[/color]

      I think the OP wants to restrict the user when editing nodes' labels to
      enter uppercase characters only.

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

      Comment

      • Siva M

        #4
        Re: Upper Text in a TreeView

        In the same KeyPress event, have:

        KeyPressEventAr gs.KeyChar = Char.ToUpper (e.KeyChar)
        (or)
        KeyPressEventAr gs.KeyChar = UCase (e.KeyChar)

        "Tony" <G@G.it> wrote in message
        news:e6wsbuTjFH A.2772@TK2MSFTN GP12.phx.gbl...
        Hello,

        In a textbox it is possible set charapters to upper with this property :
        CharacterCasing = Upper

        In a treeView not is possible...

        In Vb i set in a Event form KeyPress --> keyascii =
        asc(ucase(chr(k eyascii)))

        in dotnet ?



        Comment

        • Gigi

          #5
          Re: Upper Text in a TreeView

          Error : KeyChar is ReadOnly


          Comment

          • Gigi

            #6
            Re: Upper Text in a TreeView

            You Have Understand..

            How do?


            Comment

            • Herfried K. Wagner [MVP]

              #7
              Re: Upper Text in a TreeView

              "Gigi" <G@G.it> schrieb:[color=blue]
              > You Have Understand..
              >
              > How do?[/color]

              I feel sorry, but I don't have any idea.

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

              Comment

              • Gigi

                #8
                Re: Upper Text in a TreeView

                Is possible in Form_keypress Upper all text.

                In VB6:
                form_keypress
                keyascci = asc(ucase(chr(k eyascii)))

                dotnet?


                Comment

                • Jan Hyde

                  #9
                  Re: Upper Text in a TreeView

                  "Tony" <G@G.it>'s wild thoughts were released on Wed, 20 Jul
                  2005 16:59:17 +0200 bearing the following fruit:
                  [color=blue]
                  >Hello,
                  >
                  >In a textbox it is possible set charapters to upper with this property :
                  >CharacterCasin g = Upper
                  >
                  >In a treeView not is possible...
                  >
                  >In Vb i set in a Event form KeyPress --> keyascii =
                  >asc(ucase(chr( keyascii)))
                  >
                  >in dotnet ?[/color]

                  I haven't actually used the treeview in dotnet yet but would
                  this suffice?

                  Private Sub TreeView1_After LabelEdit(ByVal sender As
                  Object, ByVal e As
                  System.Windows. Forms.NodeLabel EditEventArgs) Handles
                  TreeView1.After LabelEdit
                  e.Node.Text = e.Label.ToUpper
                  e.CancelEdit = True
                  End Sub




                  Jan Hyde (VB MVP)

                  --
                  The best remedy for forgetfulness is milk of amnesia
                  (Richard Lederer)

                  [Abolish the TV Licence - http://www.tvlicensing.biz/]

                  Comment

                  • Siva M

                    #10
                    Re: Upper Text in a TreeView

                    Sorry, I didn't realize it's a TreeView for a minute.

                    Ok, one option to make the node text upper is to handle the AfterLabelEdit
                    event like this:

                    e.Node.Text = e.Label.ToUpper ()
                    e.CancelEdit = True

                    Though it allows to enter lower-case characters, when the user exits label
                    editing, the label text is made upper-case.

                    Will this work for you?

                    "Gigi" <G@G.it> wrote in message
                    news:%239RRF1cj FHA.1444@TK2MSF TNGP10.phx.gbl. ..
                    Error : KeyChar is ReadOnly



                    Comment

                    Working...