c# - WinForm: Inherited Panel wont Autosize -


first of all: english pretty bad. i'm sorry if there grammar , writing errors.

my question:

our company using same dll lot of programs. in on of multiused dlls, created basic ui object, used often. found bug, when dll used in specific programm:

my team created panel via winform. normaly works great: whenever start panel, form autosized according current free space got. realize this, used following code:

this.tablelayoutpanelmain.autosize = true;             this.tablelayoutpanelmain.autosizemode = system.windows.forms.autosizemode.growandshrink; 

no problems far. but, after specific panel used again in same program - think created panel inherited somehow - wont autosize anymore. instead got pre-defined size:

this.tablelayoutpanelmain.size = new system.drawing.size(341, 69); 

i dont have idea, why panel isnt reloading again , autosizing again. biggest issue here is, dont have access specific program, bug occurs , our dll used. know error somehow occours there.

i not pro-programmer. think has how implemented panel. think, created once, never again. there 1 panel, used pretty often. while doing this, wont refresh, nor using autosize function aymore.

to prevent bug, believe somehow have implement like: refresh, whenever used, please autosize.

but have absolutley no idea. i've never worked winforms, xaml. if me this, appreciate it.

the code:

    this.tablelayoutpanelmain.autosize = true;     this.tablelayoutpanelmain.autosizemode = system.windows.forms.autosizemode.growandshrink;     this.tablelayoutpanelmain.columncount = 3;     this.tablelayoutpanelmain.columnstyles.add(new system.windows.forms.columnstyle(system.windows.forms.sizetype.percent, 100f));     this.tablelayoutpanelmain.columnstyles.add(new system.windows.forms.columnstyle(system.windows.forms.sizetype.absolute, 16f));     this.tablelayoutpanelmain.columnstyles.add(new system.windows.forms.columnstyle(system.windows.forms.sizetype.absolute, 218f));     this.tablelayoutpanelmain.controls.add(this.panelpasswordrepetitionerror, 1, 2);     this.tablelayoutpanelmain.controls.add(this.txtrepetition, 2, 2);     this.tablelayoutpanelmain.controls.add(this.lblpasswordrepetition, 0, 2);     this.tablelayoutpanelmain.controls.add(this.panelpassworderror, 1, 0);     this.tablelayoutpanelmain.controls.add(this.txtpassword, 2, 0);     this.tablelayoutpanelmain.controls.add(this.paneldummy, 0, 1);     this.tablelayoutpanelmain.controls.add(this.passwordqualitybox1, 2, 1);     this.tablelayoutpanelmain.dock = system.windows.forms.dockstyle.fill;     this.tablelayoutpanelmain.location = new system.drawing.point(0, 0);     this.tablelayoutpanelmain.margin = new system.windows.forms.padding(0);     this.tablelayoutpanelmain.name = "tablelayoutpanelmain";     this.tablelayoutpanelmain.rowcount = 3;     this.tablelayoutpanelmain.rowstyles.add(new system.windows.forms.rowstyle());     this.tablelayoutpanelmain.rowstyles.add(new system.windows.forms.rowstyle(system.windows.forms.sizetype.absolute, 20f));     this.tablelayoutpanelmain.rowstyles.add(new system.windows.forms.rowstyle());     this.tablelayoutpanelmain.size = new system.drawing.size(341, 69);     this.tablelayoutpanelmain.tabindex = 0; 

forgot this:

// pdfpasswordview //  this.autoscaledimensions = new system.drawing.sizef(6f, 13f); this.autoscalemode = system.windows.forms.autoscalemode.font; this.autosize = true; this.autosizemode = system.windows.forms.autosizemode.growandshrink; this.autovalidate = system.windows.forms.autovalidate.enableallowfocuschange; this.controls.add(this.tablelayoutpanelmain); this.doublebuffered = true; this.margin = new system.windows.forms.padding(0); this.name = "pdfpasswordview"; this.size = new system.drawing.size(341, 69); this.validated += new system.eventhandler(this.onpdfpasswordviewvalidated); this.tablelayoutpanelmain.resumelayout(false); this.tablelayoutpanelmain.performlayout(); ((system.componentmodel.isupportinitialize)(this.errorprovider)).endinit(); ((system.componentmodel.isupportinitialize)(this.markerprovider)).endinit(); this.resumelayout(false); this.performlayout(); 

so found out problem was:

it working if started via debug mode (attach process), not when started release. seems weird. seems release jumping on code.


Comments

Popular posts from this blog

amazon web services - S3 Pre-signed POST validate file type? -

c# - Check Keyboard Input Winforms -