Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SubClass

Status
Not open for further replies.

WCSO

Programmer
Nov 7, 2005
25
US
I finally learned to sub class and started with a form. I've done what I need to do so when I create a new form, is shows my new sub-class and the form appears the way I intended. But how can I get existing forms to be based on my subclass? When I look at the properties of the form, it shows None for the ClassLibrary but does not allow me to change it.
 
You can't from designer. You must hack the form to do this.
Make a good backup first (VERY GOOD ONE)

Open form as a table.
Code:
*** Extention is needed
USE MyForm.SCX 
SET FILTER TO [form] $ LOWER(Class)
BROWSE NORMAL

Change Class to match the Your Class name, ClassLoc to point VCX (use relative paths, not constant, i.e lib\MyNewForm.VCX, not d:\myProg\lib\myNewForm.VCX)where you defined your class, Leave BaseClass as is.
Close form and compile it (COMPILE FORM MyForm)
CHeck to see what happens :eek:)


Borislav Borissov
 
OOPS. I find a many many more easy way :)

Open Class Browser, Open Your Form, Right Click on It and Choose REDEFINE, Then just select your Class
:)

Borislav Borissov
 
I wasn't comfortable with the hack idea and I agree with you. I tried the Class Browser but just can't seem to figure out the steps I need to do. Any thoughts on how exactly to do it?
 
Open Class Browser. Click to open file. Choose Form from file types and open your form. I treeView RightClick on the form and choose REDEFINE.

Borislav Borissov
 
That's what I have been trying. When I click Redfine, it as for a location. I pick my vcx file and it shows the classes I made. I click the form class and click ok. When it returns, the location is empty. If I click the dropdown, it shows what I selected. If I select it and click ok it tells me the location cannot be found. If I leave the location empty no change is noted for the classlibrary in the properties of the form when I open it.

To make sure all was ok, when I start a new form, it shows the ClassLibrary I setup.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top