Open a form in code
Posted
#1
(In Topic #1287)
Regular

This doesn't work.
Code
Dim hForm As New Form["FMain"]
I hope this isn't a daft question!
Posted
Regular

I assume you have a set of different forms, "ThisForm", "ThatForm" etc.
You also have a set of criteria for deciding which form you want….
The way I have always done this is along the lines of
Have a nice weekend 8-)
b
Posted
Regular

the project has about 20 forms and which may change/increase/decrease with time, also I'm logging form usage in an sql database.
The forms are opened from a menu event so: "MyMenus_Click()" allows me to retrieve the name of the form to be opened. If I could the open that form using the string returned from the database the code would be greatly simplified.
Posted
Posted
Regular

Enjoy the whisky.
Bill
Posted
Regular

Posted
Regular

Code
theForm=Object.New(theFormName)Would it be possible to open a given form (knowing only the form's name) from a library?
At the moment I get the error "Cannot load class 'form name'. File or directory does not exist.
Any ideas would be appreciated
Thanks
Posted
Guru

Posted
Regular

Bill
Posted
Guru

Posted
Expert

I use this subroutine to open all but the main form in all of my projects.
I declare it in the a project module where all the generic subroutines & functions are called from.
It 'should' work from your MyLib but obviously testing is required…
Code (gambas)
- InForm.Resizable = CanResize
- InForm.Center
- InForm.Show
- InForm.ShowModal
Cheers - Quin.
I code therefore I am
I code therefore I am
Posted
Regular

Regards
1 guest and 0 members have just viewed this.

