I am trying to run code that binds a DataGridView control on a TabPage. I
inserted the code in the TabPage_Click event, but when the tab is clicked,
the event never fires.

I understand it is necessary to set the StandardClick style to enabled. I
can't seem to find a StandardClick style on the TabControl, but I used the
following code in the Form_Load event.

this.SetStyle(ControlStyles.StandardClick, true);
this.UpdateStyles();

Still no click event...

Am I doing something wrong?

--
Regards,

Fred Chateau
http://hotelmotelnow.com

Re: TabPage Control OnClick Event by Ashot

Ashot
Fri Jun 01 16:52:45 CDT 2007

The parent TabControl has a few events that you can handle:

Selecting()
SelectedIndexChanged()
Selected()


"Fred Chateau" <webmaster@hotelmotelnow.com> wrote in message
news:eSKvTSJpHHA.3644@TK2MSFTNGP02.phx.gbl...
>I am trying to run code that binds a DataGridView control on a TabPage. I
>inserted the code in the TabPage_Click event, but when the tab is clicked,
>the event never fires.
>
> I understand it is necessary to set the StandardClick style to enabled. I
> can't seem to find a StandardClick style on the TabControl, but I used the
> following code in the Form_Load event.
>
> this.SetStyle(ControlStyles.StandardClick, true);
> this.UpdateStyles();
>
> Still no click event...
>
> Am I doing something wrong?
>
> --
> Regards,
>
> Fred Chateau
> http://hotelmotelnow.com
>
>