Dialog box Decoration property setting has no effect at runtime

As far as I’ve understood, when you set the property value With Title Bar to No the Title Bar (nor the X) shouldn’t appear when loading the Dialog. If you select No in design mode the Dialog is seen without the bar, but it seems that the setting is ignored at runtime as well as if you check it in the preview window.

This has no affect either:

    With myMsgDialog.Model
        .PositionX = (factor * oWindowPosSize.Width - .Width) / 2
        .PositionY = (factor * oWindowPosSize.Height - .Height) / 2
        .setPropertyValue("Decoration", False) 'Switching between False/True has no affect 
    End With

I don’t care if X works or not, I’m looking for a way to completely avoid the Title Bar from appearing.

Please upload ODT with example dialog and macro.

TestMsgDialog.odt (11.5 KB)

Unfortunately I didn’t discover the solution :-(.
Maybe the Popup window could help sometimes:

Sub showPopupWindow
	dim oDoc as object, oWindow as object, oVCur as object
	dim aRect as new com.sun.star.awt.Rectangle, oPopup as object, n&, c&
	oDoc=ThisComponent
	oWindow=oDoc.CurrentController.Frame.ComponentWindow
	oVCur=oDoc.CurrentController.ViewCursor 'view cursor

	aRect.X=400
	aRect.Y=100
	
	oPopup=CreateUnoService("stardiv.vcl.PopupMenu") 'or com.sun.star.awt.PopupMenu
	c=1
	oPopup.insertItem(c, "blabla 1", 0, c)
	oPopup.setCommand(c, "item" & c)
	c=2
	oPopup.insertItem(c, "blabla 2", 0, c)
	oPopup.setCommand(c, "item" & c)	

	n=oPopup.execute(oWindow, aRect, com.sun.star.awt.PopupMenuDirection.EXECUTE_DEFAULT)
	if n>0 then 
		msgbox oPopup.getCommand(n)
	end if
End Sub

@KamilLanda

Thank you for your answer.
The PopupWindow you suggested would be perfect if I could handle it the same way I do with my Dialog, i.e. I could show the box without executing and then hide and destroy it when the Wait time has elapsed.

myMsgDialog.setVisible(True)
Wait 2000
myMsgDialog.setVisible(False)
myMsgDialog.Dispose()
ThisComponent.setModified(False)

Works fine under Windows!
Sans titre

@LibreOfficiant
Yes it works when using a Standard Dialog, but you can’t hide the Title Bar, at least I can’t do it (at least yet)

Would something such as the InfoBar suit you?
https://wiki.documentfoundation.org/ReleaseNotes/6.3#Core_.2F_General

IIRC you can close it past some elapsed time

@LibreOfficiant

Thx for your tip. I’ll look into it and see what it can offer me.

But from one thing to another. I did study possibilties to set event listeners to controls placed on the Pages of my MultiPage (I don’t set my Dialog to execute but only make it visible). I came to a conclusion that you can’t set keyEvent listener to controls because it affects directly to topWindow event listener I set. When firing a keyEvent it has such an effect that the key event firing tries to unactivate the topWindow eventhandler (i.e. it crashes, because it doesn’t recognize parameter it catches). Instead, you can set listeners/event handlers to e.g. TextBox text change and to ComboBox item change events. It’s a “bit” tricky of course, but you can make it work quite seamlessly. Here’s a simple demo:
Simple.odt (16.8 KB)
with just a dialog box, a text box, and a combo box, but you’ll easily get the idea.