首页 \ 问答 \ 创建对话框的实例并从主窗口调用它(Create instance of a dialog and call it from the mainwindow)

创建对话框的实例并从主窗口调用它(Create instance of a dialog and call it from the mainwindow)

我来自Qt,我有一个对话框类,并像这样用它从主窗口打开对话框:

void MainWindow::on_pushButton_clicked(){
    Dialog *x = new Dialog();
    x->show();}

现在我想用WPF做同样的事情。 如何创建一个对话框以及如何使用它?


I'm coming from Qt where i had a dialog class and used it like this to open the dialog from the mainwindow:

void MainWindow::on_pushButton_clicked(){
    Dialog *x = new Dialog();
    x->show();}

Now i want to do the same using WPF. How do i create a dialog as a class and how to use it?


原文:https://stackoverflow.com/questions/36520599
更新时间:2022-02-21 22:02

最满意答案

移动用户的带宽更有限,连接速度更慢。 在考虑页面加载速度时,您需要牢记这一点,因为这会极大地影响用户体验。

我会避免使用移动幻灯片 - 或者至少使用适合屏幕大小的较小图像进行幻灯片放映。 例如,当您使用360px宽屏幕时,无需下载宽度为720px的图像。

滚动到可能会正常工作。 您可能想要考虑的一个问题是,如果您使用JavaScript作为“scrollTo”功能,则使用触摸事件而不是单击事件。 ( 关于触摸事件介绍 。)

至于你的游乐场页面,这完全取决于你计划在那里放置哪些演示。 我会在移动设备上测试你的例子,看看它们是否有意义并在那里正常运行; 如果他们这样做,那么显示它们。 如果没有,要么改进它们以便在移动设备上工作,要么不在移动设备上显示它们。


Mobile users have more limited bandwidth and slower connection speeds. That's something you want to keep in mind when considering how quickly the page will load as that can greatly impact user experience.

I would avoid using the slideshow for mobile -- or at least doing a slideshow that uses smaller images appropriate to the screen size. You don't need to download an image that's 720px wide when you're on a 360px wide screen, for example.

Scroll to will probably work fine. One consideration you may want to take is to use touch events rather than click events if you're using JavaScript for the "scrollTo" functionality. (A presentation on touch events.)

As for your playground page, that will depend entirely which demos you're planning to put there. I'd test out your examples on mobile to see if they make sense and function properly there; if they do, then display them. If not, either improve them to work on mobile or don't show them on mobile.

相关问答

更多
  • 一种解决方案是修改bootstrap.css文件并删除所有媒体查询。 这个问题似乎是重复的。 您可以在此处查看包含详细解决方案的原始帖子: 重复: 如何删除Twitter Bootstrap 3中的响应功能? One solution would be to modify the bootstrap.css file and remove all of the media queries. This questions seems to be a duplicate. You can see the ori ...
  • Twitter的Bootstrap默认是响应式的。 这包括所有组件和网格。 要找到答案,请先学习http://getbootstrap.com/css/#grid Twitter的Bootstrap定义了四个网格。 最大的网格最大容器大小为1170px。 大(col-lg- *)受到以下约束: /* Large devices (large desktops, 1200px and up) */ @media (min-width: @screen-lg-min) { ... } 您的设计需要更大的网格, ...
  • 由于天气应用程序的高度,它被推下来。 天气应用程序必须具有硬编码宽度,使其比您指定的col-6 “更瘦”。 我建议你这样做: 将主要部分分成两半,然后在左半部分内放置一排仪表,并在那一排键盘下面。 在右半边你的天气应用程序。
    Gauge1
    (对不起,这里的回复很晚,它出现了搜索)。 我使用Twitter Bootstrap与Primefaces相当不错。 一般来说,你需要注意数据表以及所有其他与移动设备不兼容的组件,但总的来说我一直非常高兴。 此外,Primefaces有一个皮肤,以支持引导的外观和感觉,所以你可以开箱即用。 下行? 它看起来像一个bootstrap应用程序。 上行? 您无需事先做好所有响应式工作,也无需为大多数网站做足够的工作。 (Sorry for the late reply here, it popped up on ...
  • 我使用了好运的highcharts.js : www.highcharts.com 。 它是免费的非商业用途,你可以设计它用于不同的分辨率。 我之前使用过响应式设计,效果很好。 I've used highcharts.js with good luck: www.highcharts.com. It's free for non-commercial use, and you can style it to be used on different resolutions. I've used it wi ...
  • Bootstrap 首先是移动设备 ,所以你应该使用它。 您可以为每个列添加多个类,以使它们在每个大小上看起来不同:
    X
    X
    X
    X
    ...
  • 在设置 - >常规 - >浏览中禁用“开始输入时搜索文本”。 Disable "Search for text when you start typing" in settings -> general -> browsing.
  • 一个好的做法是使用%可以使用它,因为它减少了编写另一个响应代码的工作量,因为它根据屏幕大小工作但我们使用px也在%我们不能使用%然后在我们写的@media查询根据屏幕尺寸,另一个css。 例如 假设我们需要在一个全宽div中创建2个半宽div,我们可以像这样用%来编写它 HTML
    CSS .parent{ width:100 ...
  • 移动用户的带宽更有限,连接速度更慢。 在考虑页面加载速度时,您需要牢记这一点,因为这会极大地影响用户体验。 我会避免使用移动幻灯片 - 或者至少使用适合屏幕大小的较小图像进行幻灯片放映。 例如,当您使用360px宽屏幕时,无需下载宽度为720px的图像。 滚动到可能会正常工作。 您可能想要考虑的一个问题是,如果您使用JavaScript作为“scrollTo”功能,则使用触摸事件而不是单击事件。 ( 关于触摸事件的介绍 。) 至于你的游乐场页面,这完全取决于你计划在那里放置哪些演示。 我会在移动设备上测试你 ...
  • 测量屏幕宽度,如果宽度超过480,则仅附加hellobar脚本: 更换: 附: