Windows Develop Bookmark and Share   
 index > Windows Forms General > Change controls of inherited Form?
 

Change controls of inherited Form?

Hi there,

Is there a way to be able to change the Controls that are inside a Form you inherit?

For example;

Say I have a Form that contains a Button. If I now inherit this Form, I want to be able to resize or move this Button during Design time.

Kind regards,

saphua_fk  Monday, November 05, 2007 9:08 AM

Maybe this one can help:

http://msdn2.microsoft.com/en-us/library/aa984465(VS.71).aspx

Hi

Stefano Benedetti

Be-St  Monday, November 05, 2007 9:49 AM

Look at accesibilty levels:

http://msdn2.microsoft.com/en-US/library/ba0a1yw2(VS.80).aspx

Declared accessibility Meaning

public

Access is not restricted.

protected

Access is limited to the containing class or types derived from the containing class.

internal

Access is limited to the current assembly.

protected internal

Access is limited to the current assembly or types derived from the containing class.

private

Access is limited to the containing type.

Hi

Stefano Benedetti

Be-St  Monday, November 05, 2007 10:59 AM

You can do it from code in inherited form (in initializecomponent or load event).
Can you explain in detail why you have to move buttons or other objects (maybe you can use anchor to move button leaving them attached to an edge of the form).

Stefano Benedetti

Be-St  Monday, November 05, 2007 9:46 AM

Maybe this one can help:

http://msdn2.microsoft.com/en-us/library/aa984465(VS.71).aspx

Hi

Stefano Benedetti

Be-St  Monday, November 05, 2007 9:49 AM

Thanks for the replies, changing the property Modifiers to Protected did the job.

What is the difference between Public and Protected?

Kind regards,

saphua_fk  Monday, November 05, 2007 10:51 AM

Look at accesibilty levels:

http://msdn2.microsoft.com/en-US/library/ba0a1yw2(VS.80).aspx

Declared accessibility Meaning

public

Access is not restricted.

protected

Access is limited to the containing class or types derived from the containing class.

internal

Access is limited to the current assembly.

protected internal

Access is limited to the current assembly or types derived from the containing class.

private

Access is limited to the containing type.

Hi

Stefano Benedetti

Be-St  Monday, November 05, 2007 10:59 AM

You can use google to search for other answers

Custom Search

More Threads

• dll references
• Changing the Form Size when WindowState is Maximized
• setting a date in the calendar control
• DVR-MS file thumbnail extraction
• calling KeyChar attribute on programatically added textbox with keypress event
• Changing the text in an MDIForm's StatusBar from a Module
• Messagebox
• Desktop Sidebar using C#??
• how can i avoid firing multi-resize event?
• Logical Problem in Picturebox