User Control
 
Home My Account Forum Try It! Buy It!
About Contact Us Site Map
StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



User ControlExpand / Collapse
Author
Message
Posted 05/12/2008 5:39:35 PM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: Yesterday @ 10:32:31 PM
Posts: 402, Visits: 1,633
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
Progytech (Computer Consultants)
Post #16345
Posted 05/12/2008 8:11:56 PM


Advanced StrataFrame User

Advanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame User

Group: StrataFrame Users
Last Login: Today @ 2:23:46 AM
Posts: 595, Visits: 11,522
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.
Post #16346
Posted 05/12/2008 8:49:42 PM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: Yesterday @ 10:32:31 PM
Posts: 402, Visits: 1,633
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.

Any other suggestions?

Edhy Rijo
Progytech (Computer Consultants)
Post #16347
Posted 05/13/2008 9:35:21 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 9:47:36 PM
Posts: 4,115, Visits: 4,185
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

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.

Post #16360
Posted 05/13/2008 9:56:39 AM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: Yesterday @ 10:32:31 PM
Posts: 402, Visits: 1,633
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

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
Progytech (Computer Consultants)
Post #16368
Posted 05/13/2008 10:03:15 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 9:47:36 PM
Posts: 4,115, Visits: 4,185
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

Post #16369
Posted 05/13/2008 10:16:35 AM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: Yesterday @ 10:32:31 PM
Posts: 402, Visits: 1,633
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.

Edhy Rijo
Progytech (Computer Consultants)
Post #16372
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 2:36am

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.109. 9 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.