Vb. NET Octopus Brother Production-How to troubleshoot MDI child forms overridden by controls in the parent form

Source: Internet
Author: User

Recently, a netizen asked me this question, I went online search, the result is very disappointed, there are several in the CSDN on the help post, see finally did not find a clear answer. Here I found on the Internet API function SetParent (), and the online error has been modified, 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, everyone progress together     ' declaration setparent function, which is an API function    Declare Function SetParent Lib "user32" Alias "SetParent" (ByVal hwndchild as INTPTR, ByVal hwndnewparent as INTPTR) as Lo ng    Private Sub Form1_Load (ByVal sender as System.Object, ByVal e as System.EventArgs) Handles mybase.load        ME.ISMD IContainer = True ' sets Form1 to parent form container    End Sub    Private Sub button1_click (ByVal sender as System.Object, ByVal e as Syst Em. EventArgs) Handles Button1.Click        ' Form1 is the parent form, Form2 is a subform        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 MDI child forms overridden by controls in the parent form

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.