Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Making visual classes in .NET
Message
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 9.0
OS:
Windows Server 2008
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01518209
Message ID:
01518281
Views:
67
>>>>>>>In vfp, w can make visual classes in vfp including form classes. Anybody knows how to do form classes in visual way with .NET?
>>>>>>
>>>>>>Hi Luis,
>>>>>>
>>>>>>All you have to do is create a Form as you usually would. When you need to sub-class from that Form, the easiest thing to do is just create another form, and change the class in code.
>>>>>>
>>>>>>So when you add a new Form, the class gets generated like this:
>>>>>>
>>>>>>
>>>>>>public partial class TestForm : Form
>>>>>>{
>>>>>>    public TestForm()
>>>>>>    {
>>>>>>        InitializeComponent();
>>>>>>    }
>>>>>>}
>>>>>>
>>>>>>
>>>>>>Replace the System Form with yours:
>>>>>>
>>>>>>
>>>>>>public partial class TestForm : MyBaseForm
>>>>>>{
>>>>>>    public TestForm()
>>>>>>    {
>>>>>>        InitializeComponent();
>>>>>>    }
>>>>>>}
>>>>>>
>>>>>>
>>>>>>Also, take a look at my blog post for sub-classing other controls (such as TextBox, ComboBox, etc.):
>>>>>>
>>>>>>http://geek-goddess-bonnie.blogspot.com/2009/10/why-and-how-to-sub-class-base-classes.html
>>>>>>
>>>>>>~~Bonnie
>>>>>
>>>>>Dear Geek Goddess,
>>>>>
>>>>>That's really the only way to do it? Clone and modify? I am not disputing what you say, was just expecting more inheritance than that.
>>>>
>>>>You don't get to do it like VFP. Apparently that was too easy. We can't have that.
>>>
>>>IIRC, in VFP, you first had to save the form as a class. In .NET it is already a class - all you have to do is tell another form that they inherit from it. What's so hard about that ?
>>
>>VFP = drag - drop.
>
>I've honestly forgotten. What did you drag and where did you drop it ?

You had to ask for details. I'd have to open up VFP to remember how to do it, but visual inheritance was there. I think all you had to do was make a class library and just start dragging controls to it.

>
>>
>>>
>>>>That's why there's XAML - to keep things from getting easier!
>>>
>>>Completely different paradigm. If you attempt to apply VFP (or even WinForms) principles to it then you are barking up the wrong tree...
>>
>>Yes. I enjoyed visual development.
>
>But the visuals were so limited :-}
____________________________________

Don't Tread on Me

Overthrow the federal government NOW!
____________________________________
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform