How to open dialog in centre in xojo web app

I am new working with Xojo web app.
We need to show webDialog at the centre of browser window.
please tell me how to achieve it ?

WebDialogs are shown centred by default although you can override that. What are you experiencing and with which browser?

WebDialog with type palette are shown by default at left top corner .
What we need is to show at the centre.

Assuming you want to show your palette dialog immediately on showing the page place this code in the resized event of your page where webdialog11 is your palette.

WebDialog11.Left = (self.Width - WebDialog11.Width) / 2 WebDialog11.Top = (self.Height - WebDialog11.Height) / 2 WebDialog11.Show

We need to show palette dialog on button action event.

Move Waynes code to the button action event and replace “self” with the name of your WebPage.
Should work.

add WebDialog to your project and change its type to modal.

Add button to your main WebPage and add this code to Button1.Action,

  dim wd as new WebDialog1
  wd.Show()

I centre my dialogs horizontally, but move them ? from the top vertically. I often call this in the Shown event:

Public Sub doCentreDialogWAD(myWebDialog As WebDialog) if Session.CurrentPage <> nil then myWebDialog.Top = Session.CurrentPage.Height / 3 myWebDialog.Left = (Session.CurrentPage.Width / 2) - (myWebDialog.Width / 2) end if End Sub