User Control


Author
Message
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Thanks for the idea, I will work on that path.

Also thanks for the new delete flag property, that will save us from having to code around it and looks much more clean. Smile

Edhy Rijo

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Then what would be the .NET way to minimize maintenance when using basically the same control in several forms?

Go at it from the other direction.  Create a toolstrip, then subclass the ListView.  On the ListView, create a property that is typed as the custom toolstrip that you created.  When you drop the ListView on the form, you can then attach the Toolstrip to the ListView using that property.  This is the same approach that we use on our RichTextToolstrip and our RTF control...it would probably give you some ideas.

Also, while we are on the subject, I did add another property to the ListView to let you decide whether the record will be marked as deleted or actually "smoked" from the database Wink

Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Trent,

Trent L. Taylor (05/13/2008)
You are thinking more along the lines of VFP...creating user controls in .NET is different...it is encapsulated whereas VFP was not and would allow you to kill yourself from time to time Smile

Then what would be the .NET way to minimize maintenance when using basically the same control in several forms?

All I want to do is have a single ToolStrip to handle some child BO functionality in several forms, I can get away with not creating the User Control and then just copy/paste the ThemeToolStrip all over, but there should be a better more efficient way to handle this.  What approach should I take?

What you will need to do is expose the internal controls within the user control as properties.  You may then have to programatically set the AddObject, EditObject, etc. via code then to the properties as the reflection type editor is not going to look at properties as well as controls on the form.  You could get more complex and emit the properties dynamically, but this gets more complicated.

Agreed, this sound a bit more complicated even though I do understand the process to get it done.

Edhy Rijo

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
You are thinking more along the lines of VFP...creating user controls in .NET is different...it is encapsulated whereas VFP was not and would allow you to kill yourself from time to time Smile

What you will need to do is expose the internal controls within the user control as properties.  You may then have to programatically set the AddObject, EditObject, etc. via code then to the properties as the reflection type editor is not going to look at properties as well as controls on the form.  You could get more complex and emit the properties dynamically, but this gets more complicated.

When you create a control, all internal controls are encapsulated to that control and the only way to access the internal controls is via code or by exposing them via another property, etc.

Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Keith Chisarik (05/12/2008)
I believe you will have to change the controls from "friend" to "protected friend" to have them be "editable" in the instance of the user control you drop on your form.

Hi Keith,

Thanks for the hint, I have tried setting the ThemedToolStrip and its buttons Modifiers to Protected Friend and all other options and still I am not able to access the ThemedToolStrip buttons to be assigned in the ListView properties. BigGrin

Any other suggestions?

Edhy Rijo

Keith Chisarik
Keith Chisarik
StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)
Group: StrataFrame Users
Posts: 939, Visits: 40K
I believe you will have to change the controls from "friend" to "protected friend" to have them be "editable" in the instance of the user control you drop on your form.

Keith Chisarik
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi,

I am creating a SF User Control with a ThemedtoolStrip to be used with the enhanced functionality of the ListView (AddObject, DeleteObject and EditObject).  After I finished the user control and dropped on a form, I can not select any buttons in the toolstrip to be assigned to the ListView, the only available object in this user control is the user control itself.

What am I missing here?

How to create a common ThemedToolStrip class to be used in several forms?

Edhy Rijo

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