不知道有什么办法,另外需要用继承子类实现,不能另外自己写一个usercontrol

解决方案 »

  1.   

      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就可以了
      

  2.   

    二楼可以, 
    "貌似不行"是意思,
    是否缺少引用
    using System.Runtime.InteropServices;