Open a form - simple Not!


Author
Message
Peter Jones
Peter Jones
Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)
Group: Forum Members
Posts: 386, Visits: 2.1K
Hi,

No doubt there is an easy solution to this but after serveral hours and failing to find it why not ask the experts? I have a project that contains a meu form (DevExpress NavBar) which is populated from the database. So, I click on an item and I now have a form name which I want to open. Here's the hard part - I can't find any way to iterate through all the forms in my project and .Show the right one, i.e. I can find a forms collection (open forms I can see but not all the forms in my project). I'm just about ready to write a large Case statement to, e.g

Select Case FormName
 Case "Form1"
          My.Forms.Form1.Show()
 Case "Form2"
          My.Forms.Form2.Show()

but obviously I don't want to do that. What's the best way of doing things?

Cheers, Peter

Replies
Ben Hayat
Ben Hayat
Advanced StrataFrame User (946 reputation)Advanced StrataFrame User (946 reputation)Advanced StrataFrame User (946 reputation)Advanced StrataFrame User (946 reputation)Advanced StrataFrame User (946 reputation)Advanced StrataFrame User (946 reputation)Advanced StrataFrame User (946 reputation)Advanced StrataFrame User (946 reputation)Advanced StrataFrame User (946 reputation)
Group: Forum Members
Posts: 374, Visits: 1.2K
I just went thru that in C# and GetType (that is used in VB) threw me off until Ben (Chase) came to rescue.

..ßen
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Ben (Chase),



Could you post a little code sample that shows how to do this if you want to pass values to a constructor of the form? This topic is in the category of "I get it until I have to code it...then I'm confused" Blink
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Peter Jones - 18 Years Ago
StarkMike - 18 Years Ago
StrataFrame Team - 18 Years Ago
Ben Hayat - 18 Years Ago
Greg McGuffey - 18 Years Ago
Peter Jones - 18 Years Ago
Trent L. Taylor - 18 Years Ago
Greg McGuffey - 18 Years Ago
Peter Jones - 18 Years Ago
Trent L. Taylor - 18 Years Ago
Greg McGuffey - 18 Years Ago
Trent L. Taylor - 18 Years Ago
                         This is why StrataFrame [b]ROCKS[/b]!

Thanks Trent! This...
Greg McGuffey - 18 Years Ago
                             No problem :) I just typed this out in the post and did not bring it...
Trent L. Taylor - 18 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search