是否可以在VB.net中调整DateTimePicker或MonthCalendar控件的大小 [英] Is it possible to resize a DateTimePicker or MonthCalendar Control in VB.net

查看:1217
本文介绍了是否可以在VB.net中调整DateTimePicker或MonthCalendar控件的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

本质上,我想重新调整我的dateTimePicker控件以适应其父容器。我试图这样做通过控制编辑器和编程,但我根本不能得到下拉日历扩展。所以2部分问题:

Essentially I want to re-size my dateTimePicker control to fit its parent container. I have tried to do this both through the Control Editor and programmatically but I simply cannot get the drop down calendar to expand at all. So 2 part question:

a)这是可能吗?

实现解决方案有一个好看的日历适合其父领域? (即使用数据网格或类似的东西)

b) Is there an easy-to-implement solution to having a good looking calendar that fits its parent field? (i.e. using a data grid or something similar)

任何帮助或知识都非常感谢!!!

Any help or knowledge is greatly appreciated!!!

推荐答案

两个对象的大小是固定的,并由其字体大小定义。因此,您可能通过影响字体大小更改其大小。这工作正常与 DateTimePicker ,但似乎不工作与 MonthCalendar 。经过快速研究,我发现了一个很好奇的建议,在:您可以考虑第三方MonthCalendar控件临时满足您的要求。

The size of both objects is fixed and defined by the size of its font. Thus you might change its size by affecting the font size. This works fine with DateTimePicker but does not seem to work with MonthCalendar. After a quick research I have found a pretty curious recommendation on the MSDN forum: "you can consider third party MonthCalendar controls to meet your requirement temporarily".

有很多第三方选项(在真正快速搜索后,我发现 this ),或者您甚至可以自己创建一个。我个人从来没有对内置控件有任何问题,但如果你的大小对你非常重要,我想你必须自己搜索/开发一些东西。

There are quite a few third-party options (after a really quick search I found this) or you might even create one by your own. I personally haven't ever had any problem with the in-built controls but if the size is so important for you I guess that you would have to search/develop something by your own.

进一步的建议:依靠WPF,它包含一个可调整的控件( DatePicker )。我想在这里强调,我不喜欢WPF,因此这个建议是因为我没有看到任何其他选项(.NET内)。

Further recommendation: rely on WPF which does contain a resizable control (DatePicker). I want to highlight here that I don't like WPF at all and that thus this recommendation is because I don't see any other option (inside .NET).

这篇关于是否可以在VB.net中调整DateTimePicker或MonthCalendar控件的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆