Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Put Visual classes (.ascx) on another form at design ti
Message
From
15/11/2006 11:10:57
Keith Payne
Technical Marketing Solutions
Florida, United States
 
General information
Forum:
ASP.NET
Category:
Class design
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01169229
Message ID:
01169883
Views:
7
>>>>Hi all,
>>>>
>>>>As a VFP developer, we're blessed to have visual design of classes and then drop a copy on any other form (or container for that matter), and have the full visual presentation on that new form (or container).
>>>>
>>>>I have a simple class (ex: MyTextbox as if derived from a textbox or label control) with minor adjustments for testing.
>>>>
>>>>When I drag this control onto a web form, all I get is a simple block that looks like a button control and given the label of its base... ie: MyTextbox1
>>>>
>>>>How do I get .net to show me the visual designer of the class as I have it on my webform. I can't even move it to an absolute position on the form, it always appears relative to another control.
>>>>
>>>>At run-time, the proper control shows and functions as I would otherwise expect.
>>>>
>>>>Thanks
>>>
>>>For absolute position you should be in absolute positioning (default is flow layout-which is the recommended one, formerly it was absolute as I remember).
>>>Cetin
>>
>>Don,
>>
>>The answer to your first question is that this is the nature of a WebUserControl (ascx). If you want to see the fully rendered control in the designer, you must create a CustomControl. Unfortunately, there is no designer for a custom control so it has to be done purely in code.
>>
>>This may be a daunting task if you have recently arrived from the VFP world. It may be best to stick with the WebUserControl until you have absorbed a good amount of the inner workings of ASP.NET.
>
>ok, but any good reading suggestions that can show a full example of a custom textbox control on the how to's from the UI perspective, and showing up with valid settings in the properties sheet as any other control... and/or maybe a container class that has (for example) a label, and a textbox control... likewise, if I drag/drop onto a web form, I can look at the properties of the outer container, and the inner label and textbox respectively.
>

Don,

I don't know of any site that shows the whole enchilada. There are plenty of 'tutorials' out there, but they are shallow. When I needed info for my controls, I ended up reasoning out the answer from clues in the help files and newsgroup posts, or through trial-and-error.

For a composite control (a container that has child controls), there is no direct access to child control properties. To get/set properties in the children, you have to create a property of the container. In the get/set of the container's property, you can modify the child controls' properties as needed.

>It's sooooo easy in Visual Foxpro, I guess we're just spoiled in this respect of full visual development in the IDE...

Even though I am an ex-VFPer, I gotta defend .NET a little here :) What you will discover as you get deeper into control development is that .NET controls can do a whole lot more than VFP controls. The downside is that there is no quickie method of subclassing a control, slapping a few extra properties on it, and using it in a form. It does require a little bit of work (but not a whole lot more work). The upside is that you get full design-time programmability. For instance, you can write a control that sends an email to a friend when it is dropped onto a form; or you can write a control that queries your AD server and presents a list of Vice Presidents in a property's dropdownlist.

Controls can launch their own custom 'builders'. The SqlDataAdapter is a good example. When you drop it onto a web form, it does all kinds of neat things like creating queries and datasets for you. Your custom controls can do the same things using the same classes that the intrinsic controls use.
Previous
Reply
Map
View

Click here to load this message in the networking platform