Upper Text in a TreeView

  • Thread starter Thread starter Tony
  • Start date Start date
T

Tony

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(keyascii)))

in dotnet ?
 
Rothariger said:
hi, i didnt understand anything...

I think the OP wants to restrict the user when editing nodes' labels to
enter uppercase characters only.
 
In the same KeyPress event, have:

KeyPressEventArgs.KeyChar = Char.ToUpper (e.KeyChar)
(or)
KeyPressEventArgs.KeyChar = UCase (e.KeyChar)

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(keyascii)))

in dotnet ?
 
Is possible in Form_keypress Upper all text.

In VB6:
form_keypress
keyascci = asc(ucase(chr(keyascii)))

dotnet?
 
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(keyascii)))

in dotnet ?

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

Private Sub TreeView1_AfterLabelEdit(ByVal sender As
Object, ByVal e As
System.Windows.Forms.NodeLabelEditEventArgs) Handles
TreeView1.AfterLabelEdit
e.Node.Text = e.Label.ToUpper
e.CancelEdit = True
End Sub




Jan Hyde (VB MVP)
 
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?

Error : KeyChar is ReadOnly
 
Back
Top