After the form is minimized, the problem of re-display is hidden.

Source: Internet
Author: User
Hide the form when the form is minimized, and double-click the tray icon to display the main form. Private Sub MainForm_SizeChanged () Sub MainForm_SizeChanged (ByVal sender As Object, ByVal e As System. EventArgs) Handles MyBase. SizeChanged
If Me. WindowState = FormWindowState. Minimized Then
Me. Visible = False
End If
End Sub

Private Sub policyiconmain_doubleclick () Sub policyiconmain_doubleclick (ByVal sender As Object, ByVal e As System. EventArgs) Handles policyiconmain. DoubleClick
If Me. Visible = False Then
Me. Visible = True
Me. WindowState = FormWindowState. Normal
End If
End Sub

Since I started to put Me. Visible = True behind Me. WindowState = FormWindowState. Normal, the displayed interface is not in the Normal state, and only a small part of the title bar is displayed. Then you can adjust the order!

The following code does not work properly:
Me. WindowState = FormWindowState. Normal
Me. Visible = True

However, the following code works properly:
Me. WindowState = FormWindowState. Maximized
Me. Visible = True

According to this analysis, when the form is hidden, setting the WindowState of the form to be equal to FormWindowState. Normal is invalid, or there is a problem, but setting it to Maximized is OK, strange!

Remember later.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.