Click here to Skip to main content
15,891,204 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Open/Close Forms: Has anybody seen this problem? Pin
Brad Fackrell19-Jul-05 10:00
Brad Fackrell19-Jul-05 10:00 
GeneralRe: Open/Close Forms: Has anybody seen this problem? Pin
Anonymous19-Jul-05 13:05
Anonymous19-Jul-05 13:05 
GeneralRe: Open/Close Forms: Has anybody seen this problem? Pin
Brad Fackrell20-Jul-05 2:26
Brad Fackrell20-Jul-05 2:26 
GeneralRe: Open/Close Forms: Has anybody seen this problem? Pin
Anonymous20-Jul-05 3:44
Anonymous20-Jul-05 3:44 
GeneralRe: Open/Close Forms: Has anybody seen this problem? Pin
Brad Fackrell20-Jul-05 4:02
Brad Fackrell20-Jul-05 4:02 
GeneralRe: Open/Close Forms: Has anybody seen this problem? Pin
Anonymous20-Jul-05 4:47
Anonymous20-Jul-05 4:47 
GeneralRe: Open/Close Forms: Has anybody seen this problem? Pin
Brad Fackrell20-Jul-05 5:26
Brad Fackrell20-Jul-05 5:26 
GeneralRe: Open/Close Forms: Has anybody seen this problem? Pin
Anonymous20-Jul-05 5:47
Anonymous20-Jul-05 5:47 
Brad Fackrell wrote:
Dim newFrmNewProject As New frmNewProject formLibrary.frmOpenProject.Hide() newFrmNewProject.ShowDialog()

Does this code work in the form displayed prior to frmNewProject?? If that works, then you have a very strange situation as it is the exact same code when you are attempting to display your newFrmMain.

But...I think the problem is the following:

In your class code you have:

Public Class formLibrary<br />
    Public Shared frmOpenProject As New Form<br />
    Public Shared frmMain As Form<br />
    Public Shared frmScoringJustification As New Form<br />
    Public Shared frmProjectName As New Form<br />
    Public Shared frmDatesAndLocation As New Form<br />
    Public Shared frmPOC As New Form<br />
    Public Shared frmArticulation As New Form<br />
    Public Shared frmCollectorsAndNotes As New Form<br />
    Public Shared frmComponents As New Form<br />
    Public Shared frmPrint As New Form<br />
    Public Shared frmNewProject As New Form<br />
End Class


Take note of the bold line in your class. Then in your btnClick event you placed:
Dim newFrmMain As New frmMain  <br />
formLibrary.frmNewProject.Hide()  <br />
newFrmMain.ShowDialog()


Again take note of the bold. Then in your previous form when you display your frmNewProject you had:
Dim newFrmNewProject As New frmNewProject  formLibrary.frmOpenProject.Hide()  <br />
newFrmNewProject.ShowDialog()


Now if I am correct, when you are attempting to hide your frmNewProject using this line of code (in your btnClick):
formLibrary.frmNewProject.Hide()
It is executing...BUT it is hiding the frmNewProject in your fromLibrary class...which hasn't actually been displayed to the user. Thus appearing to do abosulutely nothing.

How does that work? You are creating a new (local) instance of frmNewProject and then using the .ShowDialog to display it. So, you can test my theory by changing what you had in your previous code:
<br />
Dim newFrmNewProject As New frmNewProject<br />
formLibrary.frmOpenProject.Hide()  <br />
newFrmNewProject.ShowDialog()


Try changing it to:
'Dim newFrmNewProject As New frmNewProject  formLibrary.frmNewProject.ShowDialog()<br />
'newFrmNewProject.ShowDialog()


I know I jumped around alot...but the main idea is that in your code you are attempting to .Hide a form that hasn't actually been displayed to the user. This is because the formLibrary.frmNewProject and newFrmNewProject are two different instances.

I hope that makes sense?!?
GeneralRe: Open/Close Forms: Has anybody seen this problem? Pin
Brad Fackrell20-Jul-05 9:08
Brad Fackrell20-Jul-05 9:08 
GeneralUrgently need help for inserting value from .net CF to SQL CE database Pin
19-Jul-05 8:38
suss19-Jul-05 8:38 
GeneralHelp: System.Reflection.TargetInvocationException Pin
Anonymous19-Jul-05 7:22
Anonymous19-Jul-05 7:22 
GeneralPopulating Dropdown list Pin
macca2419-Jul-05 5:27
macca2419-Jul-05 5:27 
GeneralRe: Populating Dropdown list Pin
StealthMaker19-Jul-05 10:14
StealthMaker19-Jul-05 10:14 
GeneralCombo Box row selected Pin
directred19-Jul-05 1:14
directred19-Jul-05 1:14 
GeneralRe: Combo Box row selected Pin
toxcct19-Jul-05 1:23
toxcct19-Jul-05 1:23 
GeneralRe: Combo Box row selected Pin
StealthMaker19-Jul-05 10:16
StealthMaker19-Jul-05 10:16 
GeneralUsing VB (VS 7.0) to dev Excel macros etc. Pin
CreepingFeature19-Jul-05 0:55
CreepingFeature19-Jul-05 0:55 
GeneralRe: Using VB (VS 7.0) to dev Excel macros etc. Pin
Kevin McFarlane19-Jul-05 9:27
Kevin McFarlane19-Jul-05 9:27 
Generalhallow only one instance of a winform Pin
fuel2run18-Jul-05 23:50
fuel2run18-Jul-05 23:50 
GeneralRe: hallow only one instance of a winform Pin
Anonymous19-Jul-05 3:42
Anonymous19-Jul-05 3:42 
GeneralRe: hallow only one instance of a winform Pin
fuel2run19-Jul-05 5:05
fuel2run19-Jul-05 5:05 
GeneralRe: hallow only one instance of a winform Pin
Anonymous19-Jul-05 5:45
Anonymous19-Jul-05 5:45 
GeneralRe: hallow only one instance of a winform Pin
fuel2run19-Jul-05 20:21
fuel2run19-Jul-05 20:21 
General.NET &amp; Crystal Report Pin
hung_ngole18-Jul-05 23:37
hung_ngole18-Jul-05 23:37 
Generalgoogle like taskbar for my application Pin
shinay18-Jul-05 21:30
shinay18-Jul-05 21:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.