c# - Read all textBox in form in my custom textbox -
i work custom textbox
in winform project, added property in custom textbox
:
private textbox _nextcontrol; public textbox nextcontrol { set { _nextcontrol=value; } { return _nextcontrol; } }
and got result form 2 textbox
(textbox1 , textbox2) in custom textbox
properties property nextcontrol
; can see textbox
es in form:
in case property nextcontrol
show textbox
in form select next control.
but when want same in new wpf costum textbox
got same condition(2 textbox
es, textbox1 , textbox2):
why don't have same result? , how in wpf project?
update:
for more explanation, in winform project use property nextcontrol
select next control ui properties.
protected override void onkeydown(keyeventargs e) { if(e.keycode==keys.down) // select next textbox chosen in textbox option _nextcontrol.select(); }
because can choose name of next textbox
in ui, i don't want code.
but not work in wpf: can't see names of textbox
es in window property nextcontrol
(automatically in winform if choose type of property = textbox
).
p.s.: custom textbox
inherited system.windows.controls.textbox
.
update:
i uploded winform project custom textbox
[here] of sample project want wpf can behaves same.
i've updated link of sample.
quick in code telling me windows form user control not compatible wpf, specially keydown event in windows form parses parameter "keyeventargs e", system.windows.form.key wpf parses "system.windows.input.key" , wpf doesn't have "select() method textbox. wpf binds controls in different way winform, therefore winfromusercontrol not work in wpf forms.
if want use similar behavior in wpf form, have write 1 supported in wpf.
Comments
Post a Comment