[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Accessing a form added to a project - easy points!

Posted on 2006-11-08
11
Medium Priority
?
240 Views
Last Modified: 2012-05-05
I know this is brain dead but I have vapor lock and for some reason cannot figure this out.

I have an existing project to which I added a form (Project->Add Windows Form->Windows Form)
I added controls and code to the that form and now want to load it from my existing app. When I type newformname.showdialog I get an error saying newformname not found. Solution Explorer shows newformname under My Project.

I know this isn't tough but I need help getting unstuck. THanks.
0
Comment
Question by:tmostad
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 35

Expert Comment

by:Raynard7
ID: 17902885
What namespace is your new form in? is in the same as the rest of the project?
0
 
LVL 1

Author Comment

by:tmostad
ID: 17902957
Good question. How do I figure that out?
0
 
LVL 35

Expert Comment

by:Raynard7
ID: 17902972
Look at the code where you are trying to call it from - it should say namespace .... at the top
then look at the code of the form it should have something similar

if they are in different namespaces then you need to either change them so they are the same - or refer to the other. ie namespace.formname.arguement
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 13

Accepted Solution

by:
newyuppie earned 2000 total points
ID: 17903006
go to the code of your form and check out what the Class name is for the form, that is the name you should be addressing no matter what the name is on the Solution Explorer, they can be different.
0
 
LVL 19

Expert Comment

by:VoteyDisciple
ID: 17903688
Two things in the "obvious but perhaps overlooked" genre:
1.  Make sure the actual name of the form is what you think it is -- just seeing NewFormName under Solution Explorer doesn't mean the form is actually named NewFormName; check the property sheet for that.

2.  You may already be doing this, but don't forget in .NET you have to do something like..

Dim frmX As New NewFormName
frmX.ShowDialog()

(That is, you can't directly write NewFormName.ShowDialog().)


You've probably already considered both, but this is one of these cases where spending eight hours hunting for a really complicated solution and finding out it was really simple would be pretty annoying so I figured I'd throw it out there.  (-:
0
 
LVL 13

Expert Comment

by:newyuppie
ID: 17903912
hi votey,
2) actually i believe that in vb2005 you can call the show dialog without instantiating the form (different from 2003 behaviour). but correct me if im wrong.
1) its what i posted just before you.
0
 
LVL 1

Author Comment

by:tmostad
ID: 17907803
I knew it was brain dead simple except when your brain is dead then all bets are off. It turned out that my form Class name had a typo and didn't match the file name listed in Solution Explorer. Thanks to all who made suggestions. This forum is well worth the money I paid.
0
 
LVL 13

Expert Comment

by:newyuppie
ID: 17907893
thanks.
but as you can see i had suggested that first.
0
 
LVL 1

Author Comment

by:tmostad
ID: 17910392
Yeah, I got the points wrong. I'll ask to get it fixed or find another way to push a couple hundred more points your way. Sorry about that.
0
 
LVL 13

Expert Comment

by:newyuppie
ID: 17910576
many thanks, i didnt mean to cause a fuss, but thanks.
NY
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses
Course of the Month18 days, 6 hours left to enroll

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question