473,385 Members | 1,353 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

new form

JB
My problem is how to create a form given the name of the form class as a
string. In essence, I would like to be able to create an instance of
frmEmployee by using Dim frm as Form = New "frmEmployee" instead of New
frmEmployee. It there any way to do this. I want to use a single event
handler to create any form selected by the user. A property of the button
that fires the event is the name of the form.
--
JB
Oct 2 '06 #1
3 901
Jb,

And what advance do you think to have from that.
That form class has to be there to create it.

Cor

"JB" <JB@discussions.microsoft.comschreef in bericht
news:5B**********************************@microsof t.com...
My problem is how to create a form given the name of the form class as a
string. In essence, I would like to be able to create an instance of
frmEmployee by using Dim frm as Form = New "frmEmployee" instead of New
frmEmployee. It there any way to do this. I want to use a single event
handler to create any form selected by the user. A property of the button
that fires the event is the name of the form.
--
JB

Oct 2 '06 #2
JB
I think I found the answer to my question in another post a few pages in.
The reason for all this is that the "menu" of buttons is created dynamically
at run time based on data from tables in an sql database. The form classes
exist but the menu doesn't until runtime. When the user clicks a btn, the
handler common to all the btns gets the form name from a property of the btn.
Now I have found out that reflection allows me to do what I want. I know
little about reflection so I will do some more reading. The reason for all
this is that the menu configuration is dependent of a number of factors,
including among others the access level of the user. I can add forms,
rearrange the menu, etc by just chaning a few table entries in an sql
database. I don't have to do anything in the front end program at all,
except add any new forms or course, but I don't have reprogram the menu each
time i want to change things.
--
JB
"Cor Ligthert [MVP]" wrote:
Jb,

And what advance do you think to have from that.
That form class has to be there to create it.

Cor

"JB" <JB@discussions.microsoft.comschreef in bericht
news:5B**********************************@microsof t.com...
My problem is how to create a form given the name of the form class as a
string. In essence, I would like to be able to create an instance of
frmEmployee by using Dim frm as Form = New "frmEmployee" instead of New
frmEmployee. It there any way to do this. I want to use a single event
handler to create any form selected by the user. A property of the button
that fires the event is the name of the form.
--
JB


Oct 2 '06 #3
GS
Great Idea, assuming the SQL db is secured properly. otherwise someone can
grant himself access
as for debugging / maintaining the application by other people, they will
need good documentation

"JB" <JB@discussions.microsoft.comwrote in message
news:29**********************************@microsof t.com...
I think I found the answer to my question in another post a few pages in.
The reason for all this is that the "menu" of buttons is created
dynamically
at run time based on data from tables in an sql database. The form
classes
exist but the menu doesn't until runtime. When the user clicks a btn, the
handler common to all the btns gets the form name from a property of the
btn.
Now I have found out that reflection allows me to do what I want. I know
little about reflection so I will do some more reading. The reason for
all
this is that the menu configuration is dependent of a number of factors,
including among others the access level of the user. I can add forms,
rearrange the menu, etc by just chaning a few table entries in an sql
database. I don't have to do anything in the front end program at all,
except add any new forms or course, but I don't have reprogram the menu
each
time i want to change things.
--
JB
"Cor Ligthert [MVP]" wrote:
Jb,

And what advance do you think to have from that.
That form class has to be there to create it.

Cor

"JB" <JB@discussions.microsoft.comschreef in bericht
news:5B**********************************@microsof t.com...
My problem is how to create a form given the name of the form class as
a
string. In essence, I would like to be able to create an instance of
frmEmployee by using Dim frm as Form = New "frmEmployee" instead of
New
frmEmployee. It there any way to do this. I want to use a single
event
handler to create any form selected by the user. A property of the
button
that fires the event is the name of the form.
--
JB

Oct 2 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: John | last post by:
Dear all, It been more than 3 days I am trying to debug this program, I interpret it using activePerl and it is giving (perl -wc code_process.pl) no error syntax but when I put it online, change...
5
by: Richard Cornford | last post by:
I am interested in hearing opinions on the semantic meaning of FORM (elements) in HTML. I have to start of apologising because this question arose in a context that is not applicable to the...
4
by: Targa | last post by:
Trying to total some price fields in a form but doesnt work when all the referenced form fields dont exisit. This is for an invoice - pulled prom a database and the form doesnt always contain the...
25
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the...
19
by: Raposa Velha | last post by:
Hello to all! Does any of you want to comment the approach I implement for instantiating a form? A description and an example follow. Cheers, RV jmclopesAThotmail.com replace the AT with the...
11
by: Jozef | last post by:
I have some old code that I use from the Access 95 Developers handbook. The code works very well, with the exception that it doesn't seem to recognize wide screens, and sizes tab controls so that...
5
by: RAJ | last post by:
hi plz tell me how to know "how window is going to close"... i have to right code for X button of forms... plz telll me thanks bye
6
by: Gary Miller | last post by:
Does anyone know how to detect a modeless form on closing by the form that invoked the modeless form? form.Show();
4
by: Alex Sibilev | last post by:
Hello, I have a really weird problem I've been trying to solve it without any luck for the last couple of hours :( I'm writing a "conference board" application (quite similar to ASP.NET...
5
by: ortaias | last post by:
I have a form which calls up a second form for purposes of data entry. When closing the data entry form and returning to the main form, things don't work as expected. When I return to the main...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.