6 Replies - 16077 Views - Last Post: 14 June 2010 - 07:16 AM Rate Topic: -----

#1 little_prince41  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 68
  • Joined: 10-August 07

Set position of MsgBox()

Posted 13 June 2010 - 08:16 PM

Hello..again

I have problem about set positon of Msgbox().I want set position of MsgBox() with center of Form
I don't know how to it? :dontgetit:

can you help me,please
Thansk you :helpsmilie:

This post has been edited by little_prince41: 13 June 2010 - 08:18 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Set position of MsgBox()

#2 _HAWK_  Icon User is offline

  • Master(Of Foo)
  • member icon

Reputation: 1067
  • View blog
  • Posts: 4,174
  • Joined: 02-July 08

Re: Set position of MsgBox()

Posted 13 June 2010 - 08:41 PM

You will have to make your own form that you use for a messagebox. Then set it's StartPosition to CenterParent.
Was This Post Helpful? 0
  • +
  • -

#3 little_prince41  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 68
  • Joined: 10-August 07

Re: Set position of MsgBox()

Posted 13 June 2010 - 10:03 PM

View Posthawkvalley1, on 13 June 2010 - 07:41 PM, said:

You will have to make your own form that you use for a messagebox. Then set it's StartPosition to CenterParent.

Thanks you, but I set my Form at some position.I want message box with center of Form any position when I move position of form

can you help me, please

thanks you.
Was This Post Helpful? 0
  • +
  • -

#4 Luc001  Icon User is offline

  • D.I.C Addict

Reputation: 84
  • View blog
  • Posts: 617
  • Joined: 04-May 09

Re: Set position of MsgBox()

Posted 14 June 2010 - 12:34 AM

Hi,

You can try something like this:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim vleft As Integer = CInt((Me.Left + (Me.Width - Form2.Width) / 2))
        Dim vtop As Integer = CInt((Me.Top + (Me.Height - Form2.Height) / 2))
        Form2.Show()
        Form2.Location = New Point(vleft, vtop)

    End Sub

Was This Post Helpful? 1
  • +
  • -

#5 little_prince41  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 68
  • Joined: 10-August 07

Re: Set position of MsgBox()

Posted 14 June 2010 - 03:36 AM

View PostLuc001, on 13 June 2010 - 11:34 PM, said:

Hi,

You can try something like this:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim vleft As Integer = CInt((Me.Left + (Me.Width - Form2.Width) / 2))
        Dim vtop As Integer = CInt((Me.Top + (Me.Height - Form2.Height) / 2))
        Form2.Show()
        Form2.Location = New Point(vleft, vtop)

    End Sub



Thanks you but I want msgBox show at center of Form

Example
Msgbox("Test") ' set location at Center of Form
How to ?
Help me,please

thanks you again
Was This Post Helpful? 0
  • +
  • -

#6 Luc001  Icon User is offline

  • D.I.C Addict

Reputation: 84
  • View blog
  • Posts: 617
  • Joined: 04-May 09

Re: Set position of MsgBox()

Posted 14 June 2010 - 04:26 AM

Hi,

Like Hawkvalley said:

Quote

You will have to make your own form that you use for a messagebox. Then set it's StartPosition to CenterParent.


To make your own messagebox you need a form that exactly acts like a messagebox.

So in the code I showed Form2 acts like a messagebox.
Was This Post Helpful? 0
  • +
  • -

#7 Jack Eagles1  Icon User is offline

  • Pugnacious Penguin (inspired by no2pencil)
  • member icon

Reputation: 183
  • View blog
  • Posts: 1,152
  • Joined: 10-December 08

Re: Set position of MsgBox()

Posted 14 June 2010 - 07:16 AM

Yep, there is no command to set the window position of the messaegebox. You need to make your own form.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1