display a second form in a central position of the first form?

albwikesl

New member
Joined
Dec 11, 2013
Messages
2
Programming Experience
Beginner
I have a problem. I would like to display a second form in a central position of the first form. I do not know how to do that.
Another problem is that I downloaded a custom theme to my program and regular calling progress bar does not work. Can someone tell me what I need to do to fix this progress bar?
 
For future reference, please keep each thread to a single topic and each topic to a single thread. You have asked two unrelated questions so they belong in separate threads. How would anyone find that second question based on the title of your thread?

With regards to the first question, CenterParent is only relevant for forms that actually have a parent, so MDI child forms only. If you want to display a top-level form such that it is concentric with another then you must set the StartPosition to Manual and do that maths yourself, e.g.
Using dialogue As New Form2
    dialogue.Location = New Point(Me.Left + (Me.Width - dialogue.Width) \ 2,
                                  Me.Top + (Me.Height - dialogue.Height) \ 2)

    dialogue.ShowDialog()
End Using
With regards to the second question, you'll need to be more specific. What theme? What ProgressBar? What do you expect to happen and what actually happens?
 
For future reference, please keep each thread to a single topic and each topic to a single thread. You have asked two unrelated questions so they belong in separate threads. How would anyone find that second question based on the title of your thread?

With regards to the first question, CenterParent is only relevant for forms that actually have a parent, so MDI child forms only. If you want to display a top-level form such that it is concentric with another then you must set the StartPosition to Manual and do that maths yourself, e.g.
Using dialogue As New Form2
    dialogue.Location = New Point(Me.Left + (Me.Width - dialogue.Width) \ 2,
                                  Me.Top + (Me.Height - dialogue.Height) \ 2)

    dialogue.ShowDialog()
End Using
With regards to the second question, you'll need to be more specific. What theme? What ProgressBar? What do you expect to happen and what actually happens?

Thanks, you answer on first question helped me fix it.
Regards to the second question. I'm using GhostTheme (this is form theme to add new buttons, bars etc.). Without this form my default progress bar works correctly, but when I try to add animate GhostProgressBar nothing happens. Idk why.
 
Back
Top