Close is a Custom Button I made.

    Dim CloseButton As New Close

    Private Sub CloseButtonCode() Handles Me.Load
        CloseButton.Anchor = AnchorStyles.Top And AnchorStyles.Right
        CloseButton.Enabled = True
        CloseButton.Location = New Point(1170, 0)
        CloseButton.Size = New Size(30, 30)
        CloseButton.Visible = True
        Controls.Add(CloseButton)
        AddHandler CloseButton.Click, AddressOf CloseButtonClick
    End Sub

Whenever I Maximise, this button doesn't move to the top right corner like it's supposed to. Any help? Thanks in advance.

Oh friend, that was a simple one. Here's a help:

CloseButton.Anchor = AnchorStyles.Top + AnchorStyles.Right
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.