Vb. NET Octopus Brother Production-How to troubleshoot an MDI child window that is covered by a control in the parent window

Source: Internet
Author: User

Recently, a netizen asked me this question, I went online search, the results are very disappointed. There are several help posts on the csdn. There was no clear answer at the end of the view.

Here I found on the Internet API function SetParent (), and the online error has been changed, and gave a simple example code.

Readers can test themselves:

Public Class Form1    ' octopus brother, qq:3107073263 Group: 309816713          ' If you have any questions or good suggestions please contact me. Everybody progress together     ' Declare the SetParent function.  This is an API function    Declare functions SetParent Lib "user32" Alias "SetParent" (ByVal hwndchild as INTPTR, ByVal hwndnewparent as INTPTR) as Long    Private Sub Form1_Load (ByVal sender as System.Object, ByVal e as System.EventArgs) Handles Mybase.loa D        me.ismdicontainer = True ' Sets Form1 to the parent window container    End sub    Private Sub button1_click (ByVal sender as System.Object, ByVal e as System.EventArgs) Handles Button1.Click        ' Form1 is the parent window, Form2 is a child window        SetParent (Form2.handle, Me.handle)        form2.show ()    End Sub    Private Sub button2_click (ByVal sender as System.Object, ByVal e as System.EventArgs) Handles button2.click
   setparent (Form3.handle, Me.handle)        form3.show ()    End subend Class

Effect:

Vb. NET Octopus Brother Production-How to troubleshoot an MDI child window that is covered by a control in the parent window

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.