SF Main Form template question


Author
Message
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Good thing we've got Ben to the rescue... Whistling
StrataFrame Team
S
StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Ah, I didn't realize that Ben mentioned that it was the MainForm template... I was thinking that this was the MaintenanceForm template.  The MainForm template is always going to go "gray" because the background of the form is covered up by the MdiContainer since the IsMdiContainer is set to true.  Ivan's code is correct if you want to set the background color or an image on the background of a MainForm... you have to set the background on the MdiContainer, not the form itself.  So, you can either use Ivan's code (which isn't guaranteed to work if the MdiContainer is not the first/last control in the form's collection), or you can leave the IsMdiContainer to False, and manually create an MdiContainer object within code in the constructor of the form before the InitializeComponent ever even fires.
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Hi Ben.

I've faced this issue some months ago, and Googling it I got to something that said this was something to do with MDI parents... I have you understood this completely now, don't you? Hehe

So, I put this code in the form load:

'Me.Controls(Me.Controls.Count - 1).BackColor = Color.White

'Me.Controls(Me.Controls.Count - 1).BackgroundImage = Global.Offisys.ProFilmeNET.My.Resources.Resources.logo_profilme

'Me.Controls(Me.Controls.Count - 1).BackgroundImageLayout = ImageLayout.Center

'Me.BackgroundImage = Global.Offisys.ProFilmeNET.My.Resources.Resources.logo_profilme

'Me.BackgroundImageLayout = ImageLayout.Center

You might ask... why is your code commented? Because then I decided that the default state looked better... go figure... Tongue

 


StrataFrame Team
S
StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Thanks for the notice on that... I'll see if I can figure out why it's going to gray.
Ben Hayat
Ben Hayat
Advanced StrataFrame User (516 reputation)Advanced StrataFrame User (516 reputation)Advanced StrataFrame User (516 reputation)Advanced StrataFrame User (516 reputation)Advanced StrataFrame User (516 reputation)Advanced StrataFrame User (516 reputation)Advanced StrataFrame User (516 reputation)Advanced StrataFrame User (516 reputation)Advanced StrataFrame User (516 reputation)
Group: Forum Members
Posts: 374, Visits: 1.2K
Ben Thanks!;



Since you're going to look at MainForm Template, I've noticed another issue. One is that, If I change the backColor of the form, at runtime it goes to gray again. Secondly, If you put an image for background, At runtime it shows it a split second and then the gray color overwrites it. So, The mainForm Template needs a little clean up!

..ßen
StrataFrame Team
S
StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
With a panel manager, yes, all of the controls are instantiated at runtime, so you might have a load-time penalty if you have some 50 controls on 15 different pages.  However, not all of the pages paint... they only paint when they're visible, so you don't have a penalty there.  So, your choice to use a PanelManager over separate forms depends upon whether you want all of the functionality on the same form.  If you don't want your users to have to leave the form, then you can use a PanelManager, but if want them to leave the form, then use separate forms.  It's up to you.

As for your first question, the ThemedMaintenanceFormToolstrip is a new invention, and it just hasn't been included in the template.  The MaintenanceFormToolstrip was first used because there was no themed version.  I agree with you and after discussing it with everyone else, we'll probably change the template.  Thanks Smile

Ben Hayat
Ben Hayat
Advanced StrataFrame User (516 reputation)Advanced StrataFrame User (516 reputation)Advanced StrataFrame User (516 reputation)Advanced StrataFrame User (516 reputation)Advanced StrataFrame User (516 reputation)Advanced StrataFrame User (516 reputation)Advanced StrataFrame User (516 reputation)Advanced StrataFrame User (516 reputation)Advanced StrataFrame User (516 reputation)
Group: Forum Members
Posts: 374, Visits: 1.2K
Hi;



Question 1:When using SF MainForm Template, why is the toolstrip uses Std version versus Themed Version? Any reason I should be aware of, or can I replace it with Themed.

I think the Template should use the themed version as default.

---------------------

Second question: One option to show my form is to create a form in VS and then then create an instance of the form and the use Show() to display that from menu.

Another option is to use "PanelManager" and on each panel page put my controls on it.

The question is, which one is more efficient or better for memory? Does PanelManager creates all the pages at loading time?

Are there any limits on how many pages I can have?



Thanks!

..ßen
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search