Winforms Visibility issues on Dynamically Loaded UserControls? -
so have program dynamically loads in usercontrols depending on criteria, problem i'm having validation truly working on first textbox loaded.
the following code ran each usercontrol loaded:
try textbox = directcast(flprepeatconts.controls(count).controls("tbanswertext"), telerik.wincontrols.ui.radtextbox) ' control(1) = textbox answer labelansid = directcast(flprepeatconts.controls(count).controls("lblqid"), radlabel) labelminholder = directcast(flprepeatconts.controls(count).controls("lblmintextholder"), radlabel) lblvalidationtext = directcast(flprepeatconts.controls(count).controls("lblvalidationtext"), radlabel) if textbox.text.length >= labelminholder.text , textbox.text.length <= textbox.maxlength 'good go. lblvalidationtext.visible = false else 'too little/not enough text if labelminholder.text = textbox.maxlength lblvalidationtext.text = string.format("text must {0} characters! ({1} of {0})", labelminholder.text, textbox.text.length) else lblvalidationtext.text = string.format("text must between {0} , {1} characters!", labelminholder.text, textbox.maxlength) end if inerror = true lblvalidationtext.visible = true end if catch ex exception 'exception handling here end try count += 1
the true issue here labels past first 1 never show (unless there's atleast 1 character in respective textbox, in case error message show). i'm stumped , hoping set of eyes see don't. i've set breakpoints , stepped through , text , visibility are in fact being set, don't take effect.
Comments
Post a Comment