Changing controls to Base Classes


Author
Message
Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
Is it possible to change classes easily on exisitng forms. I have a no. of forms set up with SF classes and now want to change these forms to use my own base classes.

Now that I feel comfortable with my Base Classes, I want to go back over any forms that have been done and change the class the controls are based on.

 (e.g. for TextBoxes, ChkBoxes,Tabs etc). IN VFP, I used to do this by going behind the scenes and editing the .scx file...just wondering if there is something similar in VS.

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.4K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
The same sort of thing is found in each form's .Designer file. This file has the declarations for all the controls uses on the form. At the very bottom, it declares a bunch of fields, one for each control. Then at the top of the InitializeComponent() method, it instantiates each of these fields. You need to replace the existing SF types with your own types. There are a couple of ways to get this done:



1. Open the designer file, go to the end of the file. Look for control fields that need to be updated and update them. Then look to see what errors now exist, click on errors to go to the line that instantiates the field and fix those.

2. Use Find and Replace. You could do this across the entire solution or just open each designer file individually. I'd definitely verify each replace.



I'd suggest you use method one on one or two designer files until you understand what you're doing, then let 'er rip with find and replace! BigGrin
Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
Hi Greg.. thanks for your very informative reply.

I'll check that out and note your comments about proceeding with caution !!

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search