Uidatepicker in app designer

9次观看(最近30天)
Ricardo Pedó
Ricardo Pedó on 20 Apr 2018
Commented: Arshad Ilahion 3 Dec 2019
Is there any way to place a uidatepicker element inside an existing app designer panel? The samples I've seen only show how to do that creating a new figure...
7条评论
Arshad Ilahi
Arshad Ilahi on 3 Dec 2019
Hello Eker,
您可以分享将UIDESPICKER元素放入现有应用程序设计器面板中所做的工作吗?

Sign in to comment.

答案(5)

Chris Portal
Chris Portal on 21 Apr 2018
编辑:Per Isakson on 21 Apr 2018

You can pass the panel’s handle as the parent for the uidatepicker. The syntax is described here:

//www.tianjin-qmedu.com/help/matlab/ref/uidepicker.html


Ricardo Pedó
Ricardo Pedó on 21 Apr 2018
编辑:Per Isakson on 21 Apr 2018

Thank you Chris. I've already read that link, but I couldn't undestand how to use panel as an object. May you show me an example? In my code I have app.Panel inside a TabGroup. I tried something like the example below, but it didn't work:

uidatePicker(app.panel,'displayformat','dd-mm-yyyy');
1 Comment
Chris Portal
Chris Portal on 21 Apr 2018
嗯,这就是您需要做的。您遇到的错误是什么?

Sign in to comment.


Ricardo Pedó
Ricardo Pedó on 21 Apr 2018
Doing that way I don't get error message, but datapicker element don't show up in the panel...
1 Comment
Chris Portal
Chris Portal on 21 Apr 2018
如果您以同一代码行将按钮将按钮放在面板上,是否显示该按钮?

Sign in to comment.


Ricardo Pedó
Ricardo Pedó on 21 Apr 2018
No, now I got this error: Error using uidatepicker (line 44) Button cannot be a parent.
1 Comment
Chris Portal
Chris Portal on 21 Apr 2018

抱歉,我的意思是评论您的日期选择器的代码行,并添加此代码行:

b = uibutton(app.panel);

Does the button show up in the panel? This will determine whether the issue is with date picker specifically or something else.

Sign in to comment.


Ricardo Pedó
Ricardo Pedó on 21 Apr 2018
Ahh now I got your idea. Yes, the button shows up. Seems to be something related to the date picker...
2 Comments
Ricardo Pedó
Ricardo Pedó on 21 Apr 2018
Yeah, that's the bug! It worked... Thank you Chris!!

Sign in to comment.

Community Treasure Hunt

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

开始狩猎!