c# 4.0 - Deselect text in a textbox -
i have windows form sets text property in textbox of string variable. when form ran, has of text in textbox selected. need try , figure out how keep happening. tried
deslectall()
method on textbox doesn't seem work. tried
txtbox.selectnextcontrol(txtcostsummary, true, false, true, true);
but kind of guessing on paramters needed set to, tweaking them doesn't seem make difference. understand i'm doing i'll make little more clear on how happening.
public form1() { apple = new apple(); a.iwantthistext = "item 1: " + 50.00 + "\r\n"; txtbox.text = a.iwantthistext; } class apple { private string iwantthistext; public string iwantthistext { { return iwantthistext; } set { iwantthistext += value; } // appends there before } }
everything works fine except part has printed information in textbox text in textbox selected, isn't thought happen, nor want happen.
thanks ideas!
try this:
txtbox.select(0, 0);
Comments
Post a Comment