c# - User control keeps stretching once dropped on form -


this may winforms newb mistake, i've created user control has 1 component on - telerik dropdownlist control. when drop on form looks correct. however, run form control stretches off form.

the dropdownlist on user control has anchor property set top/left/right/bottom.

before:

here's looks after dropping on form

after:

here's looks after running

what heck doing wrong here?

edit: bit more info: if close designer , open up, changes sizes. code doesn't appear cause problem. in fact, commented out of code (besides initializecomponent() call) , still see problem. control still works - when run form populated data i'm expecting. it's stretched.

i can "work around" issue setting width of dropdownlist 35 pixels less size want be, when resizes it's correct width, shouldn't have to.

you on right track. looks though anchoring way off page. try removing anchor right starters see effect has. if doesn't work, perhaps try different combinations of anchoring see effect has on control.

make sure there no docking settings enabled, undo anchoring have on control.

check see dropdownlist control contained in. said in usercontrol, within grid in uc or else that? also, ensure user control sized (not outside bounds of page) -- cause anchoring problem. use background color test this.

next, check maximum/minimum size of control (perhaps consider setting one?).

if else fails, delete dropdownlist , create new 1 , see if have same problem. designer side of code gets glitchy , causes problems or accidentally change didn't mean to.

finally, last resort, use normal drowndownlist ;)


Comments

Popular posts from this blog

jasper reports - Fixed header in Excel using JasperReports -

media player - Android: mediaplayer went away with unhandled events -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -