dynamically populate the hashtable
-
I know how to use the hashtable. So far I have my program working by sending the forms to the hastable in code. Like so... dim ptr as windows.forms.form ptr = new frmOne hashtable.add(ptr) what I would like to do is replace the code above with code that will dynamically populate the hashtable, something to the effect of... if projecttype\object\whatever is a system.windows.forms.form then hashtable.add(projecttype\object\whatever) I can't figure out how to do it I tried using reflection.assembly.getexecutingassembly however a forms BaseType is not always stated as system.windows.forms.form it can also be the project namespace.formname, which completely negates the whole purpose of using it.
Ferron
-
I know how to use the hashtable. So far I have my program working by sending the forms to the hastable in code. Like so... dim ptr as windows.forms.form ptr = new frmOne hashtable.add(ptr) what I would like to do is replace the code above with code that will dynamically populate the hashtable, something to the effect of... if projecttype\object\whatever is a system.windows.forms.form then hashtable.add(projecttype\object\whatever) I can't figure out how to do it I tried using reflection.assembly.getexecutingassembly however a forms BaseType is not always stated as system.windows.forms.form it can also be the project namespace.formname, which completely negates the whole purpose of using it.
Ferron
I've got a bigger question. Why are you trying to do this at all?? What's the point of jumping through all these hoops?
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
I've got a bigger question. Why are you trying to do this at all?? What's the point of jumping through all these hoops?
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007I need to create a hashtable collection of all the forms in my project. It needs to be done in code and it needs to be done without any user input. It also needs to be able to be portable from one project to another without rewritting any code, so the list needs to be created dynamically. Do u know how to achieve this, or can anyone point me in the correct direction? Thanks
Ferron
-
I need to create a hashtable collection of all the forms in my project. It needs to be done in code and it needs to be done without any user input. It also needs to be able to be portable from one project to another without rewritting any code, so the list needs to be created dynamically. Do u know how to achieve this, or can anyone point me in the correct direction? Thanks
Ferron
ferronrsmith wrote:
I need to create a hashtable collection of all the forms in my project. It needs to be done in code and it needs to be done without any user input.
I'll ask again. Why??
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007