DateTimePicker控件,我想替换下拉按钮的图标 不知道有什么办法,另外需要用继承子类实现,不能另外自己写一个usercontrol 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 private void Form2_Load(object sender, EventArgs e) { PictureBox _PictureBox = new PictureBox(); _PictureBox.Height = dateTimePicker1.Height; _PictureBox.Width = 24; _PictureBox.Image = this.Icon.ToBitmap(); _PictureBox.Click += new EventHandler(_PictureBox_Click); _PictureBox.Location = new Point(dateTimePicker1.Width - 24, 0); dateTimePicker1.Controls.Add(_PictureBox); } void _PictureBox_Click(object sender, EventArgs e) { Control _Control = (Control)sender; DateTimePicker _TimePicker = _Control.Parent as DateTimePicker; if (_TimePicker != null) { SendMessage(_TimePicker.Handle, 0x0104, 0x28, 0); } } [DllImport("user32.dll", CharSet = CharSet.Auto)] public static extern int SendMessage(IntPtr hWnd, int msg, int wParam, int lParam);绘制PictureBox就可以了 二楼可以, "貌似不行"是意思,是否缺少引用using System.Runtime.InteropServices; Json时间格式怎么转换成正常格式?在线等! mutex的问题,诚心请教 txt转换为图片 修改listview中图片,再保存到SQL数据库中问题,高手接招 SQL删除空纪录,哪里不对了? 有没有什么方法可以通用的操作xml,读写查询替换等。而不管xml的格式是什么样(有命名空间或没有的)? ???如何调用远程服务器的webservices,可以返回dataset么,会不会很慢,或者拿不到 简单代码帮忙查一下错误! combobox与datagrid联动 怎样初始化一个数组? c#线程级别问题,很有意思小程序,也很有问题 图片显示时,是生成缩略图和做临时的生成,放内存里面哪种好.
{
PictureBox _PictureBox = new PictureBox();
_PictureBox.Height = dateTimePicker1.Height;
_PictureBox.Width = 24;
_PictureBox.Image = this.Icon.ToBitmap();
_PictureBox.Click += new EventHandler(_PictureBox_Click);
_PictureBox.Location = new Point(dateTimePicker1.Width - 24, 0); dateTimePicker1.Controls.Add(_PictureBox);
} void _PictureBox_Click(object sender, EventArgs e)
{
Control _Control = (Control)sender;
DateTimePicker _TimePicker = _Control.Parent as DateTimePicker;
if (_TimePicker != null)
{
SendMessage(_TimePicker.Handle, 0x0104, 0x28, 0);
}
} [DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern int SendMessage(IntPtr hWnd, int msg, int wParam, int lParam);
绘制PictureBox就可以了
"貌似不行"是意思,
是否缺少引用
using System.Runtime.InteropServices;