我从主窗体show出这个子窗体后,要求点击combobox的内容是现实Tooltip。现在的问题是我的子窗体一显示,就显示这个Tooltip,且无法隐藏?? 我子窗体的owner是父窗体?
我子窗体combobox的tooltip代码如下private ToolTip tooltip1 = new ToolTip();
private void comboBox1_DrawItem(object sender, DrawItemEventArgs e)
        {
            e.DrawBackground();
            e.Graphics.DrawString((this.comboBox1 .Items[e.Index]).ToString(), e.Font, System.Drawing.Brushes.Black, e.Bounds);
            if ((e.State & DrawItemState.Selected) == DrawItemState.Selected)
            {
                tooltip1.Show((this.comboBox1.Items[e.Index]).ToString(), this.comboBox1, e.Bounds.X + e.Bounds.Width, e.Bounds.Y + e.Bounds.Height);
                e.DrawFocusRectangle();
            }
        }        private void comboBox1_DropDownClosed(object sender, EventArgs e)
        {
            tooltip1.Hide(this);
        }请教大侠了!

解决方案 »

  1.   

     private void comboBox1_DropDownClosed(object sender, EventArgs e)触发失败?
      

  2.   

    我知道答案了,我吧combobox属性  改成了DropDownList了,这段代码只对combobox有效!
      

  3.   

    大家继续有没有什么好的办法啊!继续等待,我想DropDownList也出tooltip!!
      

  4.   

    ToolTip tooltip1 = new ToolTip();
            private void cmbMeetingHistoy_DrawItem(object sender, DrawItemEventArgs e)
            {
                e.DrawBackground();
               
                    e.Graphics.DrawString(((Meeting)this.cmbMeetingHistoy.Items[e.Index]).MeetingName.ToString(), e.Font, System.Drawing.Brushes.Black, e.Bounds);
                if ((e.State & DrawItemState.Selected) == DrawItemState.Selected && this.cmbMeetingHistoy.SelectedIndex != 0)
                {
                    tooltip1.Show(((Meeting)this.cmbMeetingHistoy.Items[e.Index]).MeetingName.ToString(), this.cmbMeetingHistoy, e.Bounds.X + e.Bounds.Width, e.Bounds.Y + e.Bounds.Height);
                    e.DrawFocusRectangle();
                }
                
            }        private void cmbMeetingHistoy_DropDownClosed(object sender, EventArgs e)
            {
                tooltip1.Hide(this.cmbMeetingHistoy);
                btnOK.Focus();
            }