none
Controls suddenly disappeared RRS feed

  • Question

  • Hello.
    I had a problem with the disappearance of
    toolsfrom the format with the code of each tool
    Read some of the topics about the problem, including the following

    stackoverflow


    And succeeded in showing tools
    The problem is after the tools appear on top of each other and not in their assigned places
    The tools appear together overlapping and not in their former positions drawn in the form

    The method was used in the following two steps

    1- Add the following code under Private Sub InitializeComponent ()

    Me.Controls.AddRange (New Control () {
    HEADER_,CLOSE_})


    • Edited by monemas Sunday, April 22, 2018 11:49 PM
    Sunday, April 22, 2018 11:48 PM

Answers


  • The problem is after the tools appear on top of each other and not in their assigned places
    The tools appear together overlapping and not in their former positions drawn in the form

    The method was used in the following two steps

    1- Add the following code under Private Sub InitializeComponent ()

    Me.Controls.AddRange (New Control () {
    HEADER_,CLOSE_})


    Hi monemas,

    You said that the controls have been displayed, but they were not in their assigned places, I guess that you don't set their location. For example that I put one button on form, the designer.vb will like this:

      Private Sub InitializeComponent()
            Me.Button1 = New System.Windows.Forms.Button()
            Me.SuspendLayout()
            '
            'Button1
            '
            Me.Button1.Location = New System.Drawing.Point(124, 98)
            Me.Button1.Name = "Button1"
            Me.Button1.Size = New System.Drawing.Size(75, 23)
            Me.Button1.TabIndex = 0
            Me.Button1.Text = "Button1"
            Me.Button1.UseVisualStyleBackColor = True
            '
            'Form1
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(800, 450)
            Me.Controls.Add(Me.Button1)
            Me.Name = "Form1"
            Me.Text = "Form1"
            Me.ResumeLayout(False)
    
        End Sub
    
        Friend WithEvents Button1 As Button

    So you need to set these control's location in form, then these will not appear together overlapping.

    Best Regards,

    Cherry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by monemas Monday, April 23, 2018 2:48 AM
    Monday, April 23, 2018 1:39 AM
    Moderator