473,378 Members | 1,375 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

How to create a form instance at hidden state?

Hello,

In my VB.Net application I create a new instance of my form like :

NewForm = new MyNewForm()

But with this line, this new form is automatically shown. I want it to be
hidden at the start...

Adding a line after this line like :

NewForm.Hide() or NewForm.Visible = false

didn't help. Putting this line to this new form's load event didn't help
either.

Sub Form_Load()

Me.Hide()

End Sub

How can I achieve this?

Regards,

Özden
Nov 20 '05 #1
11 2148
Cor
Hi Ozden,

If you not get something nicer you can use this
(But you have to put make that me.hide conditional otherwise you see it
never more)
:-)
Cor

\\\
Private Sub Form2_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Me.WindowState = FormWindowState.Minimized
End Sub

Private Sub Form2_VisibleChanged(ByVal sender _
As Object, ByVal e As System.EventArgs) Handles MyBase.VisibleChanged
Me.Hide()
End Sub
///

Cor

In my VB.Net application I create a new instance of my form like :

NewForm = new MyNewForm()

But with this line, this new form is automatically shown. I want it to be
hidden at the start...

Adding a line after this line like :

NewForm.Hide() or NewForm.Visible = false

didn't help. Putting this line to this new form's load event didn't help
either.

Sub Form_Load()

Me.Hide()

End Sub

How can I achieve this?

Regards,

Nov 20 '05 #2
Hello,

Thanks for this advice I'll keep in my pocket...

This solution does allow the form to make something like flash at the
beginning so I probably will be looking for a better solution...

Thanks again...

Özden

"Cor" <no*@non.com> wrote in message
news:er**************@tk2msftngp13.phx.gbl...
Hi Ozden,

If you not get something nicer you can use this
(But you have to put make that me.hide conditional otherwise you see it
never more)
:-)
Cor

\\\
Private Sub Form2_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Me.WindowState = FormWindowState.Minimized
End Sub

Private Sub Form2_VisibleChanged(ByVal sender _
As Object, ByVal e As System.EventArgs) Handles MyBase.VisibleChanged
Me.Hide()
End Sub
///

Cor

In my VB.Net application I create a new instance of my form like :

NewForm = new MyNewForm()

But with this line, this new form is automatically shown. I want it to be hidden at the start...

Adding a line after this line like :

NewForm.Hide() or NewForm.Visible = false

didn't help. Putting this line to this new form's load event didn't help
either.

Sub Form_Load()

Me.Hide()

End Sub

How can I achieve this?

Regards,


Nov 20 '05 #3
Cor
Hi Ozden,

Flash, than you did not set that form minimized in the load I think?

Cor

Thanks for this advice I'll keep in my pocket...

This solution does allow the form to make something like flash at the
beginning so I probably will be looking for a better solution...

Nov 20 '05 #4
"Özden Irmak" <oz********@isnet.net.tr> schrieb
Hello,

In my VB.Net application I create a new instance of my form like :

NewForm = new MyNewForm()

But with this line, this new form is automatically shown. I want it
to be hidden at the start...

Adding a line after this line like :

NewForm.Hide() or NewForm.Visible = false

didn't help. Putting this line to this new form's load event didn't
help either.

Sub Form_Load()

Me.Hide()

End Sub

How can I achieve this?

Regards,

Özden


There must be code that shows the form. The line "...new myneworm" itself
does not show the Form. Set a breakpoint in Form_Load and examine the
callstack to find out where and why the form is shown.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #5
* "Özden Irmak" <oz********@isnet.net.tr> scripsit:
In my VB.Net application I create a new instance of my form like :

NewForm = new MyNewForm()

But with this line, this new form is automatically shown. I want it to be
hidden at the start...


It should not be shown automatically. Post the code from the form's
constructor.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #6
Here's the code generated by windows forms designer (VS.Net 2002) :

Friend ContainerControl As Control = Nothing 'ContainerControl where other
controls are contained

#Region " Windows Form Designer generated code "

Public Sub New()

MyBase.New()

'This call is required by the Windows Form Designer.

InitializeComponent()

'Add any initialization after the InitializeComponent() call

End Sub

'Form overrides dispose to clean up the component list.

Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)

If disposing Then

If Not (components Is Nothing) Then

components.Dispose()

End If

End If

MyBase.Dispose(disposing)

End Sub

'Required by the Windows Form Designer

Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer

'It can be modified using the Windows Form Designer.

'Do not modify it using the code editor.

Friend WithEvents PGrid As System.Windows.Forms.PropertyGrid

Friend WithEvents Splt As System.Windows.Forms.Splitter

Friend WithEvents TBar As System.Windows.Forms.ToolBar

Friend WithEvents ImgLst As System.Windows.Forms.ImageList

Friend WithEvents ToolBarButton1 As System.Windows.Forms.ToolBarButton

Friend WithEvents ToolBarButton2 As System.Windows.Forms.ToolBarButton

Friend WithEvents OFile As System.Windows.Forms.OpenFileDialog

Friend WithEvents SFile As System.Windows.Forms.SaveFileDialog

Friend WithEvents CListBox As Tranztec.Windows.Forms.ToolboxService

Friend WithEvents ToolBarButton3 As System.Windows.Forms.ToolBarButton

<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

Me.components = New System.ComponentModel.Container()

Dim resources As System.Resources.ResourceManager = New
System.Resources.ResourceManager(GetType(FrmToolBo x))

Me.PGrid = New System.Windows.Forms.PropertyGrid()

Me.Splt = New System.Windows.Forms.Splitter()

Me.TBar = New System.Windows.Forms.ToolBar()

Me.ToolBarButton3 = New System.Windows.Forms.ToolBarButton()

Me.ToolBarButton1 = New System.Windows.Forms.ToolBarButton()

Me.ToolBarButton2 = New System.Windows.Forms.ToolBarButton()

Me.ImgLst = New System.Windows.Forms.ImageList(Me.components)

Me.OFile = New System.Windows.Forms.OpenFileDialog()

Me.SFile = New System.Windows.Forms.SaveFileDialog()

Me.CListBox = New Tranztec.Windows.Forms.ToolboxService()

Me.SuspendLayout()

'

'PGrid

'

Me.PGrid.BackColor = System.Drawing.SystemColors.Control

Me.PGrid.CommandsVisibleIfAvailable = True

Me.PGrid.Dock = System.Windows.Forms.DockStyle.Bottom

Me.PGrid.HelpVisible = False

Me.PGrid.LargeButtons = False

Me.PGrid.LineColor = System.Drawing.SystemColors.ScrollBar

Me.PGrid.Location = New System.Drawing.Point(0, 240)

Me.PGrid.Name = "PGrid"

Me.PGrid.Size = New System.Drawing.Size(242, 248)

Me.PGrid.TabIndex = 0

Me.PGrid.Text = "PropertyGrid"

Me.PGrid.ToolbarVisible = False

Me.PGrid.ViewBackColor = System.Drawing.SystemColors.Window

Me.PGrid.ViewForeColor = System.Drawing.SystemColors.WindowText

'

'Splt

'

Me.Splt.Dock = System.Windows.Forms.DockStyle.Bottom

Me.Splt.Location = New System.Drawing.Point(0, 236)

Me.Splt.Name = "Splt"

Me.Splt.Size = New System.Drawing.Size(242, 4)

Me.Splt.TabIndex = 1

Me.Splt.TabStop = False

'

'TBar

'

Me.TBar.Appearance = System.Windows.Forms.ToolBarAppearance.Flat

Me.TBar.Buttons.AddRange(New System.Windows.Forms.ToolBarButton()
{Me.ToolBarButton3, Me.ToolBarButton1, Me.ToolBarButton2})

Me.TBar.DropDownArrows = True

Me.TBar.ImageList = Me.ImgLst

Me.TBar.Name = "TBar"

Me.TBar.ShowToolTips = True

Me.TBar.Size = New System.Drawing.Size(242, 25)

Me.TBar.TabIndex = 2

Me.TBar.TextAlign = System.Windows.Forms.ToolBarTextAlign.Right

'

'ToolBarButton3

'

Me.ToolBarButton3.ImageIndex = 0

Me.ToolBarButton3.Text = "New"

Me.ToolBarButton3.ToolTipText = "Clears the design surface for a new
design..."

'

'ToolBarButton1

'

Me.ToolBarButton1.ImageIndex = 1

Me.ToolBarButton1.Text = "Open"

Me.ToolBarButton1.ToolTipText = "Open a previously saved layout..."

'

'ToolBarButton2

'

Me.ToolBarButton2.ImageIndex = 2

Me.ToolBarButton2.Text = "Save"

Me.ToolBarButton2.ToolTipText = "Save the current designed layout..."

'

'ImgLst

'

Me.ImgLst.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit

Me.ImgLst.ImageSize = New System.Drawing.Size(16, 16)

Me.ImgLst.ImageStream = CType(resources.GetObject("ImgLst.ImageStream"),
System.Windows.Forms.ImageListStreamer)

Me.ImgLst.TransparentColor = System.Drawing.Color.Transparent

'

'CListBox

'

Me.CListBox.BackColor = System.Drawing.SystemColors.Control

Me.CListBox.BorderStyle = System.Windows.Forms.BorderStyle.None

Me.CListBox.Dock = System.Windows.Forms.DockStyle.Fill

Me.CListBox.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawVariable

Me.CListBox.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!,
System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(162,
Byte))

Me.CListBox.IntegralHeight = False

Me.CListBox.Location = New System.Drawing.Point(0, 25)

Me.CListBox.Name = "CListBox"

Me.CListBox.SelectedCategory = Nothing

Me.CListBox.Size = New System.Drawing.Size(242, 211)

Me.CListBox.TabIndex = 4

'

'FrmToolBox

'

Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)

Me.ClientSize = New System.Drawing.Size(242, 488)

Me.ControlBox = False

Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.CListBox,
Me.TBar, Me.Splt, Me.PGrid})

Me.Name = "FrmToolBox"

Me.ShowInTaskbar = False

Me.Text = "Designer ToolBox"

Me.WindowState = System.Windows.Forms.FormWindowState.Minimized

Me.ResumeLayout(False)

End Sub

#End Region


"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:O2****************@TK2MSFTNGP11.phx.gbl...
* "Özden Irmak" <oz********@isnet.net.tr> scripsit:
In my VB.Net application I create a new instance of my form like :

NewForm = new MyNewForm()

But with this line, this new form is automatically shown. I want it to be hidden at the start...


It should not be shown automatically. Post the code from the form's
constructor.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #7
Hello,

I found the problem...My control's property, which sometimes shows the form,
was showing the form...

Thank you all...

Özden

"Özden Irmak" <oz********@isnet.net.tr> wrote in message
news:un**************@TK2MSFTNGP11.phx.gbl...
Here's the code generated by windows forms designer (VS.Net 2002) :

Friend ContainerControl As Control = Nothing 'ContainerControl where other
controls are contained

#Region " Windows Form Designer generated code "

Public Sub New()

MyBase.New()

'This call is required by the Windows Form Designer.

InitializeComponent()

'Add any initialization after the InitializeComponent() call

End Sub

'Form overrides dispose to clean up the component list.

Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)

If disposing Then

If Not (components Is Nothing) Then

components.Dispose()

End If

End If

MyBase.Dispose(disposing)

End Sub

'Required by the Windows Form Designer

Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer

'It can be modified using the Windows Form Designer.

'Do not modify it using the code editor.

Friend WithEvents PGrid As System.Windows.Forms.PropertyGrid

Friend WithEvents Splt As System.Windows.Forms.Splitter

Friend WithEvents TBar As System.Windows.Forms.ToolBar

Friend WithEvents ImgLst As System.Windows.Forms.ImageList

Friend WithEvents ToolBarButton1 As System.Windows.Forms.ToolBarButton

Friend WithEvents ToolBarButton2 As System.Windows.Forms.ToolBarButton

Friend WithEvents OFile As System.Windows.Forms.OpenFileDialog

Friend WithEvents SFile As System.Windows.Forms.SaveFileDialog

Friend WithEvents CListBox As Tranztec.Windows.Forms.ToolboxService

Friend WithEvents ToolBarButton3 As System.Windows.Forms.ToolBarButton

<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()

Dim resources As System.Resources.ResourceManager = New
System.Resources.ResourceManager(GetType(FrmToolBo x))

Me.PGrid = New System.Windows.Forms.PropertyGrid()

Me.Splt = New System.Windows.Forms.Splitter()

Me.TBar = New System.Windows.Forms.ToolBar()

Me.ToolBarButton3 = New System.Windows.Forms.ToolBarButton()

Me.ToolBarButton1 = New System.Windows.Forms.ToolBarButton()

Me.ToolBarButton2 = New System.Windows.Forms.ToolBarButton()

Me.ImgLst = New System.Windows.Forms.ImageList(Me.components)

Me.OFile = New System.Windows.Forms.OpenFileDialog()

Me.SFile = New System.Windows.Forms.SaveFileDialog()

Me.CListBox = New Tranztec.Windows.Forms.ToolboxService()

Me.SuspendLayout()

'

'PGrid

'

Me.PGrid.BackColor = System.Drawing.SystemColors.Control

Me.PGrid.CommandsVisibleIfAvailable = True

Me.PGrid.Dock = System.Windows.Forms.DockStyle.Bottom

Me.PGrid.HelpVisible = False

Me.PGrid.LargeButtons = False

Me.PGrid.LineColor = System.Drawing.SystemColors.ScrollBar

Me.PGrid.Location = New System.Drawing.Point(0, 240)

Me.PGrid.Name = "PGrid"

Me.PGrid.Size = New System.Drawing.Size(242, 248)

Me.PGrid.TabIndex = 0

Me.PGrid.Text = "PropertyGrid"

Me.PGrid.ToolbarVisible = False

Me.PGrid.ViewBackColor = System.Drawing.SystemColors.Window

Me.PGrid.ViewForeColor = System.Drawing.SystemColors.WindowText

'

'Splt

'

Me.Splt.Dock = System.Windows.Forms.DockStyle.Bottom

Me.Splt.Location = New System.Drawing.Point(0, 236)

Me.Splt.Name = "Splt"

Me.Splt.Size = New System.Drawing.Size(242, 4)

Me.Splt.TabIndex = 1

Me.Splt.TabStop = False

'

'TBar

'

Me.TBar.Appearance = System.Windows.Forms.ToolBarAppearance.Flat

Me.TBar.Buttons.AddRange(New System.Windows.Forms.ToolBarButton()
{Me.ToolBarButton3, Me.ToolBarButton1, Me.ToolBarButton2})

Me.TBar.DropDownArrows = True

Me.TBar.ImageList = Me.ImgLst

Me.TBar.Name = "TBar"

Me.TBar.ShowToolTips = True

Me.TBar.Size = New System.Drawing.Size(242, 25)

Me.TBar.TabIndex = 2

Me.TBar.TextAlign = System.Windows.Forms.ToolBarTextAlign.Right

'

'ToolBarButton3

'

Me.ToolBarButton3.ImageIndex = 0

Me.ToolBarButton3.Text = "New"

Me.ToolBarButton3.ToolTipText = "Clears the design surface for a new
design..."

'

'ToolBarButton1

'

Me.ToolBarButton1.ImageIndex = 1

Me.ToolBarButton1.Text = "Open"

Me.ToolBarButton1.ToolTipText = "Open a previously saved layout..."

'

'ToolBarButton2

'

Me.ToolBarButton2.ImageIndex = 2

Me.ToolBarButton2.Text = "Save"

Me.ToolBarButton2.ToolTipText = "Save the current designed layout..."

'

'ImgLst

'

Me.ImgLst.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit

Me.ImgLst.ImageSize = New System.Drawing.Size(16, 16)

Me.ImgLst.ImageStream = CType(resources.GetObject("ImgLst.ImageStream"),
System.Windows.Forms.ImageListStreamer)

Me.ImgLst.TransparentColor = System.Drawing.Color.Transparent

'

'CListBox

'

Me.CListBox.BackColor = System.Drawing.SystemColors.Control

Me.CListBox.BorderStyle = System.Windows.Forms.BorderStyle.None

Me.CListBox.Dock = System.Windows.Forms.DockStyle.Fill

Me.CListBox.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawVariable

Me.CListBox.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!,
System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(162, Byte))

Me.CListBox.IntegralHeight = False

Me.CListBox.Location = New System.Drawing.Point(0, 25)

Me.CListBox.Name = "CListBox"

Me.CListBox.SelectedCategory = Nothing

Me.CListBox.Size = New System.Drawing.Size(242, 211)

Me.CListBox.TabIndex = 4

'

'FrmToolBox

'

Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)

Me.ClientSize = New System.Drawing.Size(242, 488)

Me.ControlBox = False

Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.CListBox,
Me.TBar, Me.Splt, Me.PGrid})

Me.Name = "FrmToolBox"

Me.ShowInTaskbar = False

Me.Text = "Designer ToolBox"

Me.WindowState = System.Windows.Forms.FormWindowState.Minimized

Me.ResumeLayout(False)

End Sub

#End Region


"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:O2****************@TK2MSFTNGP11.phx.gbl...
* "Özden Irmak" <oz********@isnet.net.tr> scripsit:
In my VB.Net application I create a new instance of my form like :

NewForm = new MyNewForm()

But with this line, this new form is automatically shown. I want it to be hidden at the start...


It should not be shown automatically. Post the code from the form's
constructor.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>


Nov 20 '05 #8
To find out what is causing it to become visible, catch the
VisibleChanged of the form and put a break point there. Then just look at
the call stack and see what is causing the form to become visible. It is
likely the Tranztec.Windows.Forms.ToolboxService control (whatever that is)
is either explicitly making it visible or using something like wm_redraw on
the form causing it to become visible. Alternatively you may be doing
something in response to an event that is invoked as a result of a property
being initialized that is causing the form to be displayed.

"Özden Irmak" <oz********@isnet.net.tr> wrote in message
news:un**************@TK2MSFTNGP11.phx.gbl...
Here's the code generated by windows forms designer (VS.Net 2002) :

Friend ContainerControl As Control = Nothing 'ContainerControl where other
controls are contained

#Region " Windows Form Designer generated code "

Public Sub New()

MyBase.New()

'This call is required by the Windows Form Designer.

InitializeComponent()

'Add any initialization after the InitializeComponent() call

End Sub

'Form overrides dispose to clean up the component list.

Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)

If disposing Then

If Not (components Is Nothing) Then

components.Dispose()

End If

End If

MyBase.Dispose(disposing)

End Sub

'Required by the Windows Form Designer

Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer

'It can be modified using the Windows Form Designer.

'Do not modify it using the code editor.

Friend WithEvents PGrid As System.Windows.Forms.PropertyGrid

Friend WithEvents Splt As System.Windows.Forms.Splitter

Friend WithEvents TBar As System.Windows.Forms.ToolBar

Friend WithEvents ImgLst As System.Windows.Forms.ImageList

Friend WithEvents ToolBarButton1 As System.Windows.Forms.ToolBarButton

Friend WithEvents ToolBarButton2 As System.Windows.Forms.ToolBarButton

Friend WithEvents OFile As System.Windows.Forms.OpenFileDialog

Friend WithEvents SFile As System.Windows.Forms.SaveFileDialog

Friend WithEvents CListBox As Tranztec.Windows.Forms.ToolboxService

Friend WithEvents ToolBarButton3 As System.Windows.Forms.ToolBarButton

<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()

Dim resources As System.Resources.ResourceManager = New
System.Resources.ResourceManager(GetType(FrmToolBo x))

Me.PGrid = New System.Windows.Forms.PropertyGrid()

Me.Splt = New System.Windows.Forms.Splitter()

Me.TBar = New System.Windows.Forms.ToolBar()

Me.ToolBarButton3 = New System.Windows.Forms.ToolBarButton()

Me.ToolBarButton1 = New System.Windows.Forms.ToolBarButton()

Me.ToolBarButton2 = New System.Windows.Forms.ToolBarButton()

Me.ImgLst = New System.Windows.Forms.ImageList(Me.components)

Me.OFile = New System.Windows.Forms.OpenFileDialog()

Me.SFile = New System.Windows.Forms.SaveFileDialog()

Me.CListBox = New Tranztec.Windows.Forms.ToolboxService()

Me.SuspendLayout()

'

'PGrid

'

Me.PGrid.BackColor = System.Drawing.SystemColors.Control

Me.PGrid.CommandsVisibleIfAvailable = True

Me.PGrid.Dock = System.Windows.Forms.DockStyle.Bottom

Me.PGrid.HelpVisible = False

Me.PGrid.LargeButtons = False

Me.PGrid.LineColor = System.Drawing.SystemColors.ScrollBar

Me.PGrid.Location = New System.Drawing.Point(0, 240)

Me.PGrid.Name = "PGrid"

Me.PGrid.Size = New System.Drawing.Size(242, 248)

Me.PGrid.TabIndex = 0

Me.PGrid.Text = "PropertyGrid"

Me.PGrid.ToolbarVisible = False

Me.PGrid.ViewBackColor = System.Drawing.SystemColors.Window

Me.PGrid.ViewForeColor = System.Drawing.SystemColors.WindowText

'

'Splt

'

Me.Splt.Dock = System.Windows.Forms.DockStyle.Bottom

Me.Splt.Location = New System.Drawing.Point(0, 236)

Me.Splt.Name = "Splt"

Me.Splt.Size = New System.Drawing.Size(242, 4)

Me.Splt.TabIndex = 1

Me.Splt.TabStop = False

'

'TBar

'

Me.TBar.Appearance = System.Windows.Forms.ToolBarAppearance.Flat

Me.TBar.Buttons.AddRange(New System.Windows.Forms.ToolBarButton()
{Me.ToolBarButton3, Me.ToolBarButton1, Me.ToolBarButton2})

Me.TBar.DropDownArrows = True

Me.TBar.ImageList = Me.ImgLst

Me.TBar.Name = "TBar"

Me.TBar.ShowToolTips = True

Me.TBar.Size = New System.Drawing.Size(242, 25)

Me.TBar.TabIndex = 2

Me.TBar.TextAlign = System.Windows.Forms.ToolBarTextAlign.Right

'

'ToolBarButton3

'

Me.ToolBarButton3.ImageIndex = 0

Me.ToolBarButton3.Text = "New"

Me.ToolBarButton3.ToolTipText = "Clears the design surface for a new
design..."

'

'ToolBarButton1

'

Me.ToolBarButton1.ImageIndex = 1

Me.ToolBarButton1.Text = "Open"

Me.ToolBarButton1.ToolTipText = "Open a previously saved layout..."

'

'ToolBarButton2

'

Me.ToolBarButton2.ImageIndex = 2

Me.ToolBarButton2.Text = "Save"

Me.ToolBarButton2.ToolTipText = "Save the current designed layout..."

'

'ImgLst

'

Me.ImgLst.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit

Me.ImgLst.ImageSize = New System.Drawing.Size(16, 16)

Me.ImgLst.ImageStream = CType(resources.GetObject("ImgLst.ImageStream"),
System.Windows.Forms.ImageListStreamer)

Me.ImgLst.TransparentColor = System.Drawing.Color.Transparent

'

'CListBox

'

Me.CListBox.BackColor = System.Drawing.SystemColors.Control

Me.CListBox.BorderStyle = System.Windows.Forms.BorderStyle.None

Me.CListBox.Dock = System.Windows.Forms.DockStyle.Fill

Me.CListBox.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawVariable

Me.CListBox.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!,
System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(162, Byte))

Me.CListBox.IntegralHeight = False

Me.CListBox.Location = New System.Drawing.Point(0, 25)

Me.CListBox.Name = "CListBox"

Me.CListBox.SelectedCategory = Nothing

Me.CListBox.Size = New System.Drawing.Size(242, 211)

Me.CListBox.TabIndex = 4

'

'FrmToolBox

'

Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)

Me.ClientSize = New System.Drawing.Size(242, 488)

Me.ControlBox = False

Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.CListBox,
Me.TBar, Me.Splt, Me.PGrid})

Me.Name = "FrmToolBox"

Me.ShowInTaskbar = False

Me.Text = "Designer ToolBox"

Me.WindowState = System.Windows.Forms.FormWindowState.Minimized

Me.ResumeLayout(False)

End Sub

#End Region


"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:O2****************@TK2MSFTNGP11.phx.gbl...
* "Özden Irmak" <oz********@isnet.net.tr> scripsit:
In my VB.Net application I create a new instance of my form like :

NewForm = new MyNewForm()

But with this line, this new form is automatically shown. I want it to be hidden at the start...


It should not be shown automatically. Post the code from the form's
constructor.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>


Nov 20 '05 #9
Hi Ozden,
This is a tricky way however it may be helpful:

Dim NewForm As New Form2
NewForm.ShowInTaskbar = False
NewForm.FormBorderStyle = FormBorderStyle.None
NewForm.Width = 0
NewForm.Height = 0
NewForm.Show()

Try this code.

Kolay gelsin....


Nov 20 '05 #10
newformload()
me.visible = false (or)
me.opacity = 0
end sub
-----Original Message-----
Hello,

In my VB.Net application I create a new instance of my form like :
NewForm = new MyNewForm()

But with this line, this new form is automatically shown. I want it to behidden at the start...

Adding a line after this line like :

NewForm.Hide() or NewForm.Visible = false

didn't help. Putting this line to this new form's load event didn't helpeither.

Sub Form_Load()

Me.Hide()

End Sub

How can I achieve this?

Regards,

Özden
.

Nov 20 '05 #11
* <an*******@discussions.microsoft.com> scripsit:
newformload()
me.visible = false (or)
me.opacity = 0


Opacity may fail on older Windows versions or with bad graphics cards.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Jack | last post by:
I'm setting up a form and want to check if some conditions are met when the form submits. If they aren't, the form displays a missing field message and the user has to go back to fill in the...
5
by: Susan | last post by:
I have an application. When a user minimizes it it hides itselfs but stays activate in the system tray. Since it is hidden the user may think that they have exited the application and now may...
3
by: Marcel Balcarek | last post by:
Can I keep the value of (some of) my server variables across posts? I can define hidden form fields, but is there a better way? I have passed some form variables from one page to another and...
1
by: iMedia User | last post by:
I have a site where I want to use the Web form validators in two separate forms on a single page. One form allows existing users to log in while the second one allows new users to register. The...
4
by: Lee Chapman | last post by:
Hi, Can anyone tell me why in the code below, the call to ClearChildViewState() has no effect? To paraphrase the code: I'm using view state. I have a textbox and a submit button (and a label...
4
by: Mark | last post by:
Assume you have a web application with many different web pages, and you'd like to avoid using cookies and storing session state in any form. Assume further that bandwidth and security are not...
3
by: underground | last post by:
I found this form on the scripts. However when I attemp to open the php file on the sever I get a error message Parse error: syntax error, unexpected $end on line 238 <? /** * Main.php * *...
13
by: Bill Nguyen | last post by:
Is it possible to create your won XSD to use with .NET based on an XML content? For example the one below: <?xml version="1.0"?> <pcats:FuelsDoc...
11
by: newbie | last post by:
i have a form in which a hidden field (initial value as '0', and my javascript set it to '1' when an event is trigged). In the same form, i have a reset field. But I realized that the hidden field...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.