hi guys
I want to, Keep always on top , guide figure ?
Can you give an example ? or link.

댓글 수: 3

Adam Danz
Adam Danz 2021년 5월 10일
For figures created by uifigure in Matlab R2021a or later, set the WindowStyle to 'alwaysontop'.
Nasser Hosseini
Nasser Hosseini 2022년 2월 16일
How do you do it with a "msgbox", i.e. keep it always on top? It is still a "figure" and not a "uifigure".
When I try to set 'WindowStyle' as 'alwaysontop', I get error:
>> fig_id = msgbox('test');
>> set(fig_id,'WindowStyle','alwaysontop')
Error using matlab.ui.Figure/set
Functionality not supported with figures created with the figure function.
Adam Danz
Adam Danz 2022년 2월 22일
Message boxes are generated with regular figures. This property is only available for uifigures. You'll either need to generate your own message box using a uifigure or perhaps use a built-in dialog that uses uifigures (e.g. uialert).

댓글을 달려면 로그인하십시오.

 채택된 답변

Jan
Jan 2011년 5월 20일

2 개 추천

There are a lot of tools for this job in the FEX, e.g. WindowAPI. This tool can use the Windows HWnd handle as input, such that I expect it to work on not-Matlab windows also - as long as you find a method to get the HWnd...

댓글 수: 4

nsbd
nsbd 2011년 5월 20일
Yes ty bro.but I need some more help.
I want to stay always on top checkbox with a Guide.
I met this new with FEX.I do not understand.I need time.
I understand what you want to do.please write now
Jan
Jan 2011년 5월 20일
Please formulate a question again. What exactly do you need?
nsbd
nsbd 2011년 5월 20일
setFiguresAlwaysOnTop(true) %always on top
setFiguresAlwaysOnTop(false)
This should be enough :)
nsbd
nsbd 2011년 5월 20일
problem was solved.thks

댓글을 달려면 로그인하십시오.

추가 답변 (4개)

Yoav Livneh
Yoav Livneh 2011년 5월 19일

3 개 추천

set(figure_handle,'WindowStyle','modal')

댓글 수: 5

nsbd
nsbd 2011년 5월 19일
Ty Yes it worked. but just to windows :(
How can that be in the game
Yoav Livneh
Yoav Livneh 2011년 5월 19일
I don't understand your question. What do you mean?
nsbd
nsbd 2011년 5월 19일
I mean does not work on game windows.
Yoav Livneh
Yoav Livneh 2011년 5월 19일
What I suggested only works within MATLAB. I don't know how to extend it to any window, wait for someone else to answer.
Sorry I couldn't help.
nsbd
nsbd 2011년 5월 19일
:( I wrote a small program for the game.trying.just Would be nice if this property :)

댓글을 달려면 로그인하십시오.

DGM
DGM 2022년 2월 22일

1 개 추천

Similar to Jan's suggestion, you can always do the window management with ... your window management tools. Jan's recommendation works in Windows. The following works in Linux.
Attached is a simple function that will set the specified window to be on top. This relies on the use of wmctrl, so you need to have that installed. This works for msgbox windows, regular figure windows, and uifigure windows..
hmb = msgbox('test');
hflg = figure(6);
hfui = uifigure(1);
windowontop(hmb)
windowontop(hflg)
windowontop(hfui)
Of course, you can set other window properties the same way.

댓글 수: 4

Nasser Hosseini
Nasser Hosseini 2022년 2월 23일
Thank you, DGM!
Jan's suggesed WindowAPI works nicely in its demo version, but somehow it doesn't work for me (MATLAB 2021a)! I keep getting this error that WindowAPI_HG2 doesn't exist.
function WinAPI_test
FigH = figure('Color', ones(1, 3), 'Renderer', 'Painters');
% Set topmost status:
WindowAPI(FigH, 'topmost');
drawnow;
>> WinAPI_test
Unrecognized function or variable 'WindowAPI_HG2'.
Error in WindowAPI (line 236)
MexFcn(FigH, varargin{:});
Error in WinAPI_test (line 5)
WindowAPI(FigH, 'topmost');
DGM
DGM 2022년 2월 23일
I have no idea how to use those tools, and I'm in no position to troubleshoot since I don't run Windows.
Jan
Jan 2022년 2월 23일
I have no idea, why this is failing, if the demo runs correctly. I've published a new version, which does do no magic tricks anymore to support old Matlab version (HG1, <= R2014b). Now only one C-mex function is compiled. Please try it again with the new version.
Nasser Hosseini
Nasser Hosseini 2022년 2월 23일
Thank you, Jan! It worked like a charm. :-)

댓글을 달려면 로그인하십시오.

nsbd
nsbd 2011년 5월 19일

0 개 추천

windowslivemessenger also have the option "always on top"
This Did he can be done?
Shaul Shvimmer
Shaul Shvimmer 2020년 3월 17일

0 개 추천

Hi, I want to inform whoever incounters this challage using MATLAB's App Designer, there's a great solution written by Igor Varfolomeev, from my experiance it works great in MATLAB 2018b and 2019b:
Cheers, and thank you Igor!

카테고리

도움말 센터File Exchange에서 Environment and Settings에 대해 자세히 알아보기

제품

태그

질문:

2011년 5월 19일

댓글:

2022년 2월 23일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by