Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

understanding ToolStripDropDown and ToolStripControlHost

$
0
0


Hi,

I am creating a custom textbox in a listview control. I have to hide the textbox if the user
clicks anywhere in the listview inclusing header n scroll.
I have created ToolStripControlHost and passed the textbox to its constructor.

ToolStripControlHost tooHost = new ToolStripControlHost(theTextBox)

also created ToolStripDropDown object and added tooHost to it.

and then subscribe to its closing event.

Now what I have observe is that, whenever i click anywhere in the listview, the closing event fires
and in that closing event if i set 

e.Cancel = false

it hides the textbox. That is very much fine for me.

My problem is I dnt understand how it is happening. Can anyone explain me how
ToolStripDropDown and ToolStripControlHost works ??

Regards,


Viewing all articles
Browse latest Browse all 12583

Trending Articles