I Think I have found a bug. Here is the situation:
In form1 add a button and add this code:
VB Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim frm As New Form2(Me)
frm.ShowDialog()
Me.Show()
End Sub
In Form2 add this code:
VB Code:
Public Class Form2
Inherits System.Windows.Forms.Form
Dim pform As Form
#Region " Windows Form Designer generated code "
Public Sub New(ByVal frm As Form)
MyBase.New()
pform = frm
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'
'
'
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Opacity = 0.99 ' Any value less than 1
Me.Opacity = 1 ' Even if you dont change it to 1 it still happens
' MessageBox.Show(Me.ShowInTaskbar)
pform.Hide()
' MessageBox.Show(Me.ShowInTaskbar)
End Sub
You will note that when Form2 is shown its taksbar icon is hidden, despite ShowInTaskbar property of Form2 remains True. This situation happens if only
1-you change the Opacity
2- hide the parent form
3-form be shown modally.
This is tested only in VB.NET and Framework 1.1
If its a bug, how can I report it to MS? any MVP around?
Attached is the project if you want to test.
'Heading for the automatic overload'
Marillion, Brave, The Great Escape, 1994
'How will WE stand the FIRE TOMORROW?'
Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979
erm when using opacity , 1 represents 100% to make say a 10% ( almost invisible ) you need to do 0.1 , eg:
in Form1 ( no need to modify the New sub in form2 either )
Public Sub New(ByVal frm As Form)
MyBase.New()
pform = frm
^^^^ becomes...
Dim frmMain As Form1 = Owner
~ if a post is resolved, please mark it as [Resolved] protected string get_Signature(){return Censored;} [vbcode][php] please use code tags when posting any code [/php][/vbcode]
Thanks, I will test your code, but as i stated before, you dont need to have two forms to note the bug(?). Just in a single form load event (Startup form) put the following code:
VB Code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Opacity = 0.1
Me.Opacity=1 ' This does not make any difference in showing icon in taskbar
End Sub
And you see that the form is not shown in taskbar.
'Heading for the automatic overload'
Marillion, Brave, The Great Escape, 1994
'How will WE stand the FIRE TOMORROW?'
Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979
~ if a post is resolved, please mark it as [Resolved] protected string get_Signature(){return Censored;} [vbcode][php] please use code tags when posting any code [/php][/vbcode]
dynamic_sysop:
Your code still does not show the form2 in taskbar and on closing form2 breaks with StackOverFlowException. If you change frm.Show()
to frm.ShowDialog the error does not happen but still form2 is not shown in taksbar.
'Heading for the automatic overload'
Marillion, Brave, The Great Escape, 1994
'How will WE stand the FIRE TOMORROW?'
Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979