How to show a Calc or Writer main window to most front?
If VB.net, like BringToFront or TopMost.
[Solved] Bring to front the main window
[Solved] Bring to front the main window
Last edited by robleyd on Sat Jul 24, 2021 3:14 am, edited 2 times in total.
Reason: Add green tick
Reason: Add green tick
OpenOffice 3.1 on Windows 10
Re: Bring to front the main window
Maybe using setFocus() will do what you want
Code: Select all
CurrControl = ThisComponent.CurrentController
CompWin = CurrControl.ComponentWindow
CompWin.setFocus()
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
Re: Bring to front the main window
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
[Solved]
Thank you for your reply.
I failed to bring to front a document by using "XTopWindow".
===================================
Sorry, but I noticed that my XSpreadsheetDocument go behind by another reason.
A XSpreadsheetDocument went behind when I closed a jframe form.
So I resolved that by changing process order.
I failed to bring to front a document by using "XTopWindow".
===================================
Sorry, but I noticed that my XSpreadsheetDocument go behind by another reason.
A XSpreadsheetDocument went behind when I closed a jframe form.
So I resolved that by changing process order.
OpenOffice 3.1 on Windows 10
Re: [Solved] Bring to front the main window
Code: Select all
vFrames = StarDesktop.getFrames()
For i = 1 To vFrames.getCount()
with vFrames.getByIndex(i-1)
msgbox .title
.containerwindow.tofront
end with
Next
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Re: [Solved] Bring to front the main window
Thank you for your answer.
I could see that a window went to front by below codes.
================================
================================
But I've known that my problem is occurred by showing JFrame form.
When close this form, a book window go behind of other window and prevent "toFront".
I resolved this by changing code order.
I could see that a window went to front by below codes.
================================
Code: Select all
XSpreadsheetDocument xdoc;
XModel model = UnoRuntime.queryInterface(XModel.class, xdoc);
XTopWindow top_window = UnoRuntime.queryInterface(XTopWindow.class, model.getCurrentController().getFrame().getContainerWindow());
top_window.toFront();
But I've known that my problem is occurred by showing JFrame form.
When close this form, a book window go behind of other window and prevent "toFront".
I resolved this by changing code order.
OpenOffice 3.1 on Windows 10