Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Making visual classes in .NET
Message
From
16/07/2011 03:46:49
 
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:
01518338
Views:
61
>>>>>>>>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 ?
>>>>
>>>>>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...
>>>
>>>I didn't say it was hard. It just struck me as a little manual.
>>
>>Just a question of typing ':MyBaseForm' :-}
>>>
>>>It's not something I am going to get worked up over. Not only is the power back on after being out most of the past four days -- always fun in mid July -- I found a job. What a relief. VFP, SQL Server, C#.NET. Beautiful.
>>
>>Why no power ? Was it a widespread outage (horrible american word :-} )
>>Congratulations on the job (No WPF though :-{) Will it entail much travelling (or even relocation) ?
>>
>>One of the companies I work for is currently beginning the process of looking for an additional developer working primarily with WPF - it will be interesting to see the type of applicant we get......
>
>I was out of town when it happened so didn't experience it directly. In fact I was almost all the way back home before I knew anything happened. 75 mph winds swept through Chicago at around 8 Monday morning, The electric company said 865,000 customers were without power, a record. The physical damage was not that great, just lost power and a lot of dead trees. Everywhere around here downed trees and branches are stacked by the side of the road. No loss of life, so we were a lot luckier than the the tornado and earthquake zones. Nobody died. It was actually somewhat interesting living unelectronically for a few days. When the sun went down that was it, that was the end of the day. No wonder everyone had 10 kids back then.

Weird how we forget how much we depend on electricity. Every time I get a power cut and I've shut down whatever is neccessary I go down stairs, put on the electric kettle to make a cup of tea, and then sit watching it for fifteen minutes before it clicks that I'm wasting my time.

I was in NYC years ago when they had that power outage that went on for 24hrs or so. Staying in an hotel on Central Park with a flight out to London in the morning. Was in the bar when the power went. They lit some candles and continued serving even though they couldn't charge stuff to the rooms. A whole street party developed on 57th. St behind the hotel. Had a great time 'till it was time to go to bed and I remembered I was on the 27th floor. Filled all my pockets with book matches and set off on the long trek.
The electricity was still out when I left in the morning so I never got charged for the (substantial) restaurant and bar tab :-}


>Will give you details about the job privately. After the past several months I am a little paranoid.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform