Getting the TabPage of a control...
- From: "JamesB" <jame@xxxxxxxxxxxxxxxx>
- Date: Fri, 1 Aug 2008 09:22:50 +0100
I am trying to find the tab page a certain control is on.
Basically I'm using the MSRDP ActiveX Control. On the "disconnect" event, I want to then remove the TabPage that the relevant RDP session lived in. So, I have the following code:
void _tsClient_OnDisconnected(object sender, AxMSTSCLib.IMsTscAxEvents_OnDisconnectedEvent e)
{
AxMSTSCLib.AxMsRdpClient6NotSafeForScripting _dClient = (AxMSTSCLib.AxMsRdpClient6NotSafeForScripting)sender;
//get container.
TabPage _clientTab = (TabPage)_dClient.Container;
tabSessions.TabPages.Remove(_clientTab);
}
However, _clientTab is always null... I saw ContainingControl, however that won't compile as it says it cannot convert Type "System.Windows.Forms.ContainerControl' to 'System.Windows.Forms.TabPage'.
Any ideas?
.
- Follow-Ups:
- Re: Getting the TabPage of a control...
- From: Jack Jackson
- Re: Getting the TabPage of a control...
- From: JamesB
- Re: Getting the TabPage of a control...
- Next by Date: Re: Getting the TabPage of a control...
- Next by thread: Re: Getting the TabPage of a control...
- Index(es):
Loading