Question child form icon Question?

trialer

Well-known member
Joined
Oct 4, 2010
Messages
64
Programming Experience
1-3
How do i hide Child Form Icon in menustrip when its state set to maximized and show child form icon when its state set to normal state?

when i set the form property icon to showicon = false defaulticon appears in menustrip?
 
For ItemAdded event handler:
If e.Item.GetType.Name = "SystemMenuItem" Then e.Item.Visible = False
 
For ItemAdded event handler:
If e.Item.GetType.Name = "SystemMenuItem" Then e.Item.Visible = False

where would i put that
For ItemAdded event handler:

here's my code
VB.NET:
Private Sub Borrowers_SizeChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.SizeChanged
        If Me.WindowState = FormWindowState.Maximized Then
            Me.ShowIcon = False
        ElseIf Me.WindowState = FormWindowState.Normal Then
            Me.ShowIcon = True
        End If
    End Sub
 
You don't need to change ShowIcon property, just handle the ItemAdded event and use the code I posted.
 
could you make a sample code for me.. im trying to understand but no hope., can't get it.

is says that 'Item' is not member of eventargs

here my new code now

VB.NET:
  Private Sub Books_Monitoring_SizeChanged(ByVal sender As Object, ByVal e As System.EventArgs)
        AddHandler Me.SizeChanged, AddressOf Books_Monitoring_SizeChanged
        If e.Item.GetType.Name = "SystemMenuItem" Then
            e.Item.Visible = False
        End If
    End Sub
 
I said ItemAdded event, not SizeChanged event.
To add event handler in code window: select the menustrip in left combo and the event in right combo.
To add event handler in design window: select the menustrip, in Properties window select Events view and doubleclick the event.
 
Back
Top