B
BennyEz
Lets say I have a control at the bottom of my form and I have it set
to anchor Top, Bottom, Left, Right
That does exactly what I want it to do....
Ok here's my issue. I have recently taken the contents from that form
and placed them on a user control instead. I set the output type to
dll for the project with the user control. I implement my own
interface, compile, and then place the dll in a plugins directory of
my host app. My host app then rakes the directory, finds any types
that implement the interface and when it finds one it loads that user
control as a new tab in the host apps tab control.
The interface requires that there be an init function. The host always
runs this when it finds the dll and passes in DB information. Inside
the init function I have tried to also set the user controls anchor
like so:
this.Anchor = ((System.Windows.Forms.AnchorStyles)
((((System.Windows.Forms.AnchorStyles.Top |
System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
I'm not sure if the syntax is 100% in this posting because I've
commented and uncommented and recommented so many times trying
different combinations. Just know that I'm setting it the same as if I
were using the designer. Top, Bottom, Left, Right...
Now the Host app has a tab control as I've already stated. It has it's
anchor set to Top, Bottom, Left, Right so that it expands if the form
does.
Now when it loads, everything runs off the screen. So let me lay out
the context more clearly:
Host Form
- Tab control - Anchor Top, Bottom, Left, Right
- User Control found at runtime - Anchor Top, Bottom, Left, Right
- Control - anchro Top, Bottom, Left, Right
I can create the same app with just a tab control and place the end
control right on a new tab page and anchor it. That works as expected
and everything expands as it should. but once I put the control on a
user control and then load that dynamically into the tab control
setting it's anchor, everything expands way off to the right and
bottom.
Any help would be great!!!!!!!!!!!!!!!!!!!!!!
to anchor Top, Bottom, Left, Right
That does exactly what I want it to do....
Ok here's my issue. I have recently taken the contents from that form
and placed them on a user control instead. I set the output type to
dll for the project with the user control. I implement my own
interface, compile, and then place the dll in a plugins directory of
my host app. My host app then rakes the directory, finds any types
that implement the interface and when it finds one it loads that user
control as a new tab in the host apps tab control.
The interface requires that there be an init function. The host always
runs this when it finds the dll and passes in DB information. Inside
the init function I have tried to also set the user controls anchor
like so:
this.Anchor = ((System.Windows.Forms.AnchorStyles)
((((System.Windows.Forms.AnchorStyles.Top |
System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
I'm not sure if the syntax is 100% in this posting because I've
commented and uncommented and recommented so many times trying
different combinations. Just know that I'm setting it the same as if I
were using the designer. Top, Bottom, Left, Right...
Now the Host app has a tab control as I've already stated. It has it's
anchor set to Top, Bottom, Left, Right so that it expands if the form
does.
Now when it loads, everything runs off the screen. So let me lay out
the context more clearly:
Host Form
- Tab control - Anchor Top, Bottom, Left, Right
- User Control found at runtime - Anchor Top, Bottom, Left, Right
- Control - anchro Top, Bottom, Left, Right
I can create the same app with just a tab control and place the end
control right on a new tab page and anchor it. That works as expected
and everything expands as it should. but once I put the control on a
user control and then load that dynamically into the tab control
setting it's anchor, everything expands way off to the right and
bottom.
Any help would be great!!!!!!!!!!!!!!!!!!!!!!