|
Is the form you're looking for already opened? If so, you could call Application.OpenForms and find the opened form based on the name.
If your form isn't opened and you need to instantiate and display one based on the name, you can use Reflection. In particular, something like GetType.Assembly.GetType("TheNameGoesHere")
Life, family, faith: Give me a visit.
From my latest post: "And you think, 'To keep my anti-Judaic theology alive I must reinterpret this verse too as being a blessing for Christians and not for Jews. I know it strains all manner of principles of interpretation. I don’t read the newspaper this sloppily, but, man, I have a theology to defend.'"
Judah Himango
|
|
|
|
|
can you be more clear about the second case , Create an instance of a form by the form name as string only ?
thanks
|
|
|
|
|
I pointed you in the right direction already: Type theFormWeAreLookingFor = this.GetType().Assembly.GetType("TheNameGoesHere")
From there, you've got a Type. Look for the GetConstructor method, and call invoke on that. Voila! You have yourself a form. Read up on Reflection if you need more -- Gareth linked to the MSDN article in his reply to you.
|
|
|
|
|
unitecsoft,
Reflection[^]
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
I created an add-in for Visual Studio that I want to use. Everything works like I want it too. However, I want to be able to get rid of the item on the toolbar when it is deactivated. Right now for some reason it is always on my menu. Even if I go into Add-In Manager and uncheck everything.
Can someone tell me how I could get rid of this option? I would like to have it remove itself once Visual Studio closes.
Thanks
Steve Welborn
Phat Solutions
|
|
|
|
|
I'm not sure. Perhaps this would be a question better suited for the Visual Studio[^] forum or the MSDN Visual Studio Extensibility[^] forum.
Life, family, faith: Give me a visit.
From my latest post: "And you think, 'To keep my anti-Judaic theology alive I must reinterpret this verse too as being a blessing for Christians and not for Jews. I know it strains all manner of principles of interpretation. I don’t read the newspaper this sloppily, but, man, I have a theology to defend.'"
Judah Himango
|
|
|
|
|
You are probably right. I wonder if I can get by posting there and not get called out on double posts?
Thanks for the reply anyway.
Steve Welborn
Phat Solutions
|
|
|
|
|
Actually it doesn't matter. I talked myself out of even needing such a feature.
Steve Welborn
Phat Solutions
|
|
|
|
|
is it a better to dispose an object first before Removeing it from the parent control or vice versa. My next question is that if i dispose the object then how could the complier finds this object to be removed like as follows.
mycontrol.Dispose();
parent.Control.Remove(myControl);
|
|
|
|
|
Remove the control before disposing it. You'd probably end up with a runtime exception otherwise.
Disposing something does not set it to null. Disposing something merely releases any unmanaged resources, such as Win32 handles.
Life, family, faith: Give me a visit.
From my latest post: "And you think, 'To keep my anti-Judaic theology alive I must reinterpret this verse too as being a blessing for Christians and not for Jews. I know it strains all manner of principles of interpretation. I don’t read the newspaper this sloppily, but, man, I have a theology to defend.'"
Judah Himango
|
|
|
|
|
Dispose should only be called when you want to free the resource and have it await garbage collection. So never call Dispose on an object then try to access the reference to it...
-Spacix
All your skynet questions[ ^] belong to solved
I dislike the black-and-white voting system on questions/answers.
|
|
|
|
|
I have read alot of articles about the MVP pattern. I have looked a several examples, but I most are pretty trivial. I am wondering where the validation of user input should occur. I am guessing it should be in the presenter, but I am not total sure.
I have been using CSLA, which is nice but clunky in some areas. I really like the quick validation responses the user gets when the IErrorProvider interface is implemented, but I don't see a way of doing this without junking up the domain model. Hopefully someone can clear this up or point me to an article.
Thanks
|
|
|
|
|
I've seen the MVP pattern applied in various ways, and the way we apply it here at work may be different than what you're used to.
For us, we have validation at several levels: the model object, for example, Employee, "owns" the validation -- you can't make one with bad data.
However, we have stuff in place in the presenter to check for valid input (perhaps utilizing the model to determine whether it's valid data), and if it's invalid, update the view accordingly (e.g. highlight the invalid data in red).
Something along those lines. Does that help?
Life, family, faith: Give me a visit.
From my latest post: "And you think, 'To keep my anti-Judaic theology alive I must reinterpret this verse too as being a blessing for Christians and not for Jews. I know it strains all manner of principles of interpretation. I don’t read the newspaper this sloppily, but, man, I have a theology to defend.'"
Judah Himango
|
|
|
|
|
Hi there,
what is the best way to perform some tasks directlty after a C# application has been installed, where to put the code of doing things,
should I use installerclass? then where to add the action ,
please any help, just with some links
thanks in advance
There is always something to learn
|
|
|
|
|
If you're using a Setup Project to do your installation then a Custom Action may be the way to go:
Link 1[^]
Link 2[^]
|
|
|
|
|
Yeah, ideally you make this part of the installer. Your app gets installed, then the installer runs whatever steps you need. There are some articles on this site, and plenty across the web, that show you how to run custom actions as part of an installer.
Life, family, faith: Give me a visit.
From my latest post: "And you think, 'To keep my anti-Judaic theology alive I must reinterpret this verse too as being a blessing for Christians and not for Jews. I know it strains all manner of principles of interpretation. I don’t read the newspaper this sloppily, but, man, I have a theology to defend.'"
Judah Himango
|
|
|
|
|
Hello!!
How can I make an applications size to full screen?
Thanks!
|
|
|
|
|
|
Especially i am looking for answer specifically in the context of search engines. I have got the code for tokenization,stemming, tf/idf. But not able to use it.???????????
i m Chan Naseeb from Pakistan
|
|
|
|
|
then use it?
-Spacix
All your skynet questions[ ^] belong to solved
I dislike the black-and-white voting system on questions/answers.
|
|
|
|
|
chancomsats wrote: But not able to use it.???????????
You have to be a bit more specific for someone to be able to help you. How does your inability to use the classes show itself?
Too much coke in your keyboard? Your question mark key seems to be stuck...
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
I have a job to offer some one. and Just don't know where to post it. Can some one tell where I can post an ad for a VC# Developer
Thanks
Joe
|
|
|
|
|
rent a coder?
-Spacix
All your skynet questions[ ^] belong to solved
I dislike the black-and-white voting system on questions/answers.
|
|
|
|
|
|
Pete I don't know if if you saw his original post, but I did and he was looking to pay people $50 to write "modules" which were large complex applications. One of which included a whole web server with .NET ASPX support. I think rent a coder would be the better fit, but that's just me
-Spacix
All your skynet questions[ ^] belong to solved
I dislike the black-and-white voting system on questions/answers.
|
|
|
|