Security Sample question.


Author
Message
Ross L. Rooker, Sr.
Ross L. Rooker, Sr.
StrataFrame User (245 reputation)StrataFrame User (245 reputation)StrataFrame User (245 reputation)StrataFrame User (245 reputation)StrataFrame User (245 reputation)StrataFrame User (245 reputation)StrataFrame User (245 reputation)StrataFrame User (245 reputation)StrataFrame User (245 reputation)
Group: Forum Members
Posts: 153, Visits: 462
Your SecuritySample (C#) displays the main form for the app (SecurityMain) which has a flow panel to the left (pnlSide)with a themed container (ThemedContainer1). I like this approach but have a question. I want to expand on this some that when the Customers button the the SecurityMain form is clicked and the CustomerMaintenance form appears, it would dynamically add another ThemedContainer2 to the SecurityMain form's pnlSide area.

First I added a user control called CustomerMaintenanceThemedContainer which inherited from the Strataframe Themed Container. and used the Visual Designer to get it the same with, look and feel as the one already on the SecurityMain form.

My thought is to add a ThemedContainer to the pnlSide area of the SecurityMain form whenever I display another form such as the CustomerMaintenance form to give the user other information or links they could click on for the form.

When the CustomerMaintenance form first displays, what code would I need to add the Themed Container to the pnlSide area of the SecurityMain form? And then when the user CLOSES the CustomerMaintenance form, what code would be needed to removed the Themed Container from the pnlSide area on the SecurityMain form?

I added the following code on the button click of the cmdCustomers button on the SecurityMain form which does work, but this should happen as a part of the CustomerMaintenance form and not the button click on the SecurityMain form. Valet is my namespace for my application. My question is how do I get a reference to the SecurityMain form once the CustomerMaintenance form is displayed so that I can control the displaying of the associated Themed Container and removing it from the CustomerMaintenance form?

Valet.frmCustomerMaintenanceUserThemedContainer ThemedContainer2 = new frmCustomerMaintenanceUserThemedContainer();

this.pnlSide.Controls.Add(ThemedContainer2);

LaunchForm(typeof(frmCustomersMaintenance));


Replies
Ross L. Rooker, Sr.
Ross L. Rooker, Sr.
StrataFrame User (245 reputation)StrataFrame User (245 reputation)StrataFrame User (245 reputation)StrataFrame User (245 reputation)StrataFrame User (245 reputation)StrataFrame User (245 reputation)StrataFrame User (245 reputation)StrataFrame User (245 reputation)StrataFrame User (245 reputation)
Group: Forum Members
Posts: 153, Visits: 462
The reason I did not want to add the themed container to the side panel and set it's visible property is because eventually there will be 100 different forms, each with a different themedContainer to appear only when that form is displayed. By adding it to the side panel and removing it, we will not have to set all them up on the main form and toggle the visibility property.

The main form is SecurityMain. The flow panel on it is called "pnlSide". The themed container when the CustomerMaintenance form displays should be added to the pnlSide controls object on the SecurityMain form. I am using the example that came with Strataframe. Based on this, would the "base form" be the SecurityMain form, or the CustomerMaintenance form?

How do I get a reference to the pnlSide object on the SecurityMain form when the CustomerMaintenance form is displayed?
 

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
it's visible property is because eventually there will be 100 different forms, each with a different themedContainer to appear only when that form is displayed. By adding it to the side panel and removing it, we will not have to set all them up on the main form and toggle the visibility property.

I wouldn't take that approach.  The more objects that you are planning on using creates a much larger margin of error.  You are better off creating a reusable solution.  This is what we do in our medical software.  We place a ThemedLinkMenu on the left side and then update the control from a collection on the BaseForm.  So the same control is reused for all forms.  If you have more than one form up and select another form, it automatically updates the control to work with the selected form, etc.

would the "base form" be the SecurityMain form, or the CustomerMaintenance form?

BaseForm would be what the CustomerMaintenance form would inherit.

How do I get a reference to the pnlSide object on the SecurityMain form when the CustomerMaintenance form is displayed?

me.ParentForm

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