c# - Executing code when a tab is shown -
i want operations on tab when shown.
example:
textbox1.selectionstart = textbox1.text.length; textbox1.scrolltocaret(); textbox3.selectionstart = textbox3.text.length; textbox3.scrolltocaret(); textbox2.selectionstart = textbox2.text.length; textbox2.focus();
where should place code it's done properly?
the events tabcontrol1_selecting, tabcontrol1_selected , tabpage2_enter not work beause occur before tab shown.
i know first tab must shown , code must executed.
try in selectedindexchanged
event ,
private void yourtabcontrol1_selectedindexchanged(object sender, eventargs e) { textbox1.selectionstart = textbox1.text.length; textbox1.scrolltocaret(); textbox3.selectionstart = textbox3.text.length; textbox3.scrolltocaret(); textbox2.selectionstart = textbox2.text.length; textbox2.focus(); }
Comments
Post a Comment