By Charles R Hankey - 3/15/2010
Another of my "aha" moments as I crawl up the learning curve of .NET.
I'm sure this is glaringly obvious to most of you, and I know it isn't rocket science, but I want to make this observation for benefit of form VFP developers like myself who cut our teeth on inheritance and subclassing issues there :
Not only can you change the parent class of an object after it is created with no difficulty ( e.g. creating a business object baseclass subclassed from the SF one, then going into your own previously created BOs and just changing the Inherits line.) but you can change the parent class of controls that are already on a form by just hacking the designer page.
Recently had a form with 12 datagridviews, decided to create my own subclass of datagridview in my UI library. First instinct was to blow away the 12 dgvs I had and drop on my new dgvs - then stopped thinking Fox, started thinking .NET and poked around on designer page, found the lines that defined the dgvs as New System.Windows.Forms.DataGridView and changed it to New CRH.UI.dgv
OK, maybe everybody else knows that but I thought it was cool and maybe there is one other person who hadn't tried that before. Can really come in handy if you need to change the parent of 100 textboxes.
|
By Edhy Rijo - 3/15/2010
Hi Charles,
Yes, I also was very happy, as my friend Doron Farber says "like a pig in a s..t" when I discovered the same thing.
I also found that the Find/Replace functionality in VS is by far more powerful and flexible than the one in the VFP IDE so it began to be one of my best friend I usually find everything I need to in the SF source code pretty easy.
|
By Charles R Hankey - 3/15/2010
And, it should be mentioned for anyone new to the VS IDE, right clicking and picking Find all References or Go to Definition is pretty cool as well.
Tokens, bookmarks, snippets ... I'm liking VS a lot.
|
|