Hide Palette WebDialog Titlebar

I am using a Palette WebDialog cos I need to display the Palette WebDialog on a long WebPage. Using a modal or sheet WebDialog will scroll the webpage to the top of the webpage before showing the webdialog.

Is it possible to hide or get rid of the default Palette Title and the close button?

There’s no built-in way to hide the title bar. It’s meant to be draggable.

What problem are you trying to solve with this?

[quote=314487:@Alvin Lim]I am using a Palette WebDialog cos I need to display the Palette WebDialog on a long WebPage. Using a modal or sheet WebDialog will scroll the webpage to the top of the webpage before showing the webdialog.

Is it possible to hide or get rid of the default Palette Title and the close button?[/quote]

Here is a quick way. Note that addressing components of a Web control that way is not sanctioned by Xojo, because if they ever change the framework names such as “_titlebar” or “_resize”, this will cease to work.

[code] dim p as new palette1
p.show

	dim js as string
	js = "document.getElementById('"+p.ControlID+"_titlebar').style.visibility = 'hidden'; "
	js = js + "document.getElementById('"+p.ControlID+"_resize').style.visibility = 'hidden'; "
	self.ExecuteJavaScript(js)[/code]

Make sure to call the JavaScript after displaying the Palette, because JavaScript needs it to exist in the DOM.

@Greg O’Lone I bet you a million to one that Alvin is trying to create notifications that show in the top right of the page, disappearing after a few seconds.

I know I would like an easy way to do this without using JS, and palettes are the only non-modal option we have.

[quote=314517:@Greg O’Lone]There’s no built-in way to hide the title bar. It’s meant to be draggable.

What problem are you trying to solve with this?[/quote]
I am creating my own titlebar as the palette’s title text and titlebar is too small & too short. Moreover, I do not want user to click on the palette title bar as it will cause the movement of palette window to go haywire for to long WebPage Design.

Ian, Alvin, what I posted should be pretty safe, as it is not a new control, but simply a modification of the existing one. I believe it would be rather simple for Greg to create a new “plain box” palette along the same line.

A feature request is the only way to make sure the idea makes it into Xojo development.

[quote=314521:@Michel Bujardet]Here is a quick way. Note that addressing components of a Web control that way is not sanctioned by Xojo, because if they ever change the framework names such as “_titlebar” or “_resize”, this will cease to work.

[code] dim p as new palette1
p.show

	dim js as string
	js = "document.getElementById('"+p.ControlID+"_titlebar').style.visibility = 'hidden'; "
	js = js + "document.getElementById('"+p.ControlID+"_resize').style.visibility = 'hidden'; "
	self.ExecuteJavaScript(js)[/code]

Make sure to call the JavaScript after displaying the Palette, because JavaScript needs it to exist in the DOM.[/quote]
Cool Michel, it works out perfectly. Great Thanks! :slight_smile: