Inherited Form Resize problem

Please find the Zipped file containing the sample projects where I am tried to reproduce the problem I am facing.

You please download the Zip file from

http://vbcity.com/forums/attachment.asp?id=18886

OR from

http://www.msnusers.com/CSharpLearnerGroup/Documents/SampleBaseFormFieldAdded.zip

OR from

http://www30.brinkster.com/mahapatra/files/SampleBaseFormFieldAdded.zip

The zipped file contains one Class library project and another test Project (SampleBaseFormTest) to test the Class library project. The class library contains a Form which I inherits in the test project.


Open the SampleBaseForm.sln and run it. Take the screen shot of the form. Now reduce the form size a bit of frmMainTest.cs. Rebuild the solution. You will find the inherited controls are disturbed on the form. This happens only when the form is resized.


Please help me to identify why this is happening and how I can overcome this problem.

Thanking you for your kind help,

Pranab

[1622 byte] By [Pra_na_b] at [2008-1-10]
# 1
Vbcity.com requires registration, you'll have to put it somewhere else.
nobugz at 2007-10-3 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 2
Thank you very much for pointing out the difficulty which others might be also facing.

This time I uploaded in MSN group and brinkster both.

Pra_na_b at 2007-10-3 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 3
Are you able to download the code. Please guide me how I can proceed...
Pra_na_b at 2007-10-3 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 4
Look carefully at your post to see what you forgot.
nobugz at 2007-10-3 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 5

I am sorry for that. In fact I updated the original post with the new links, thinking that the new visitors will find it easy to download the files from there and forgot to mention that on the post.

Please find below the link to download the file from MSN.

http://www.msnusers.com/CSharpLearnerGroup/Documents/SampleBaseFormFieldAdded.zip

Thanks for your time.

Pra_na_b at 2007-10-3 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 6
If you don't want the Designer to move controls in a base control or a user control, make the individual controls in that base/user-control private instead of protected. The default is protected. To change it, select the control on the base (frmMainBase.Hellobutton, for example) show the properties, scroll down until Modifiers is visible, click Modifiers and select Private. Now derived forms can't set the position of those controls. This will likely cause compile errors because the designer has automatically positioned those controls based on their Dock or Anchor properties. You'll have to manually delete code in frmMainTest.Designer.cs to remove those compile errors.
PeterRitchie at 2007-10-3 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 7

Peter,

Thank you very much for your time. The solution provided by you is working up to some extend.

Purpose of frmMainBase form is to serve as a template for data entry screen.

frmMainBase.Hellobutton is also an template. During run time the button text will change and show number of modified records since last visit. On clicking the button it will display the list of those records which has been modified since the last visit of the logged on user.

Similarly the text of frmMainBase.label2 needs to be changed on the derived form to Book ID or Staff ID based on the underlying data. ToolTips also provided to give tip for that field.

By changing the Modifiers from Protected to Private, we can not able to do the above intended activities.

Please guide us, how we can achieve the required result.

Pra_na_b at 2007-10-3 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 8
Should I assume this is a bug and can not be corrected?
Pra_na_b at 2007-10-3 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 9
You simply need to implement public methods or properties that access those now private members.
PeterRitchie at 2007-10-3 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 10

Thanks Peter,

Yes, that is a good work arround. Today we tested the component after compiling in VS2003. It is behaving as expected, there is no issue as we are facing with VS2005. We are planning to use this class library which was compiled using VS2003. Any one see any problem?

Thanks for your guidance.

Pra_na_b at 2007-10-3 > top of Msdn Tech,Windows Forms,Windows Forms General...