Question Problem displaying Use rControls on navigating from Login Form


New member
Nov 19, 2012
Programming Experience
I have 2 forms in the application... frmLogin and frmMain. After login succeeds I m instantiating frmMain and calling frmMain.ShowDialog(Me) and hiding frmLogin. If I set frmMain as the startup form and run it directly, Im able to see all the user controls.... However, if i start from frmLogin... I do not see the display of a few user controls. The back end operations happen.. so the controls are not exactly failing.. however... there is no display of user controls.
In initializer I m forcing creation of handle with call to control.Handle() and then checking for Invoke required before making changes to the control.I m checking for Thread.IsBackground... but it seems to be working fine on the GUI thread. Even a user control with only labels inside is not getting displayed. (Im using only the timer/ background workers)
Only those user controls that are visible on Load are being displayed. On button click...the new controls are not getting displayed.. even if debugger shows that it is setting the visiblility/size/ color..attributes of the user control. I have tried control.refresh/ update.... but it seems to be of no use.
I m a newbee in winforms and kinda stumped.. and stuck on the issue since more than 3 days... any help would be greatly appreciated.
Top Bottom