Hi Lance,
I think I did not express clear.
When click another tab page, the tab control will fire its event, but
the button control in the tab page does not fire the its VisibleChanged
Also, the button did not generate any message.
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
| From: "Lance Johnson" <lj******@docs. com>
| References: <uJ************ *@TK2MSFTNGP09. phx.gbl>
<#7************ *@TK2MSFTNGP10. phx.gbl>
<ux************ *@TK2MSFTNGP10. phx.gbl> <bi**********@t itan.btinternet .com>
<#h************ **@TK2MSFTNGP09 .phx.gbl>
<ui************ **@cpmsftngxa06 .phx.gbl>
<OT************ **@tk2msftngp13 .phx.gbl>
<TO************ **@cpmsftngxa06 .phx.gbl>
| Subject: Re: tab control and tab changed
| Date: Fri, 12 Sep 2003 16:26:22 -0500
| Lines: 171
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <Oa************ **@TK2MSFTNGP10 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
| NNTP-Posting-Host: 204.95.153.41
| Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP10.phx.g bl
| Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1845 35
| X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
|
| That's very strange. You're saying that when a tab page gets change
there's
| no event happening on the tab page itself. Because I'm hooking into that
| event and when I click on another tab it's firing for me and I'm able to
| update my stuff correctly.
|
| Lance Johnson
|
|
| "Jeffrey Tan[MSFT]" <v-*****@online.mi crosoft.com> wrote in message
| news:TO******** ******@cpmsftng xa06.phx.gbl...
| >
| > Hi Lance,
| >
| > I can reproduce your problem.
| > When clicking the tab page, the unvisabled control does not fire
| > VisibleChanged
| > event.
| > I have used Spy++ to watch the control's message when its parent tab
page
| > get
| > unvisabled, finding that no message generated.
| >
| > I also found that the control's VisibleChanged event fires go with the
| > WM_WINDOWPOSCHA NGING and WM_WINDOWPOSCHA NGED message.
| > I think the windows implement the control's visable change by changing
| their
| > z-order, when the control on the tab page was unvisabled, its absolute
| > z-order did
| > not change, but the visable tab page's z-order get up and lay over the
| > control, so
| > the VisibleChanged event did not fire.
| > While click the tab page that contains the control, the control's
absolute
| > z-order needs
| > get up and VisibleChanged fired.
| >
| > So you can not use this way of doing what you want, please try some way
| > that we suggested.
| > It will work around your problem.
| >
| > Hope this helps.
| > Best regards,
| > Jeffrey Tan
| > Microsoft Online Partner Support
| > Get Secure! -
www.microsoft.com/security
| > This posting is provided "as is" with no warranties and confers no
rights.
| >
| > --------------------
| > | From: "Lance Johnson" <lj******@docs. com>
| > | References: <uJ************ *@TK2MSFTNGP09. phx.gbl>
| > <#7************ *@TK2MSFTNGP10. phx.gbl>
| > <ux************ *@TK2MSFTNGP10. phx.gbl>
<bi**********@t itan.btinternet .com>
| > <#h************ **@TK2MSFTNGP09 .phx.gbl>
| > <ui************ **@cpmsftngxa06 .phx.gbl>
| > | Subject: Re: tab control and tab changed
| > | Date: Mon, 8 Sep 2003 11:24:27 -0500
| > | Lines: 87
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | Message-ID: <OT************ **@tk2msftngp13 .phx.gbl>
| > | Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
| > | NNTP-Posting-Host: 204.95.153.41
| > | Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!tk2 msftngp13.phx.g bl
| > | Xref: cpmsftngxa06.ph x.gbl
| microsoft.publi c.dotnet.langua ges.csharp:1832 22
| > | X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
| > |
| > | I was just hoping there was a easier way of automatically doing this.
| > What
| > | I've done instead is to look at the parent changed event for the
control
| > and
| > | subscribe to the Parent's visibility changed event. Seems to work
well
| > | enough for me and then all of my derived controls will automatically
| work
| > | with no extra work on any tab control or anything else I might put
them
| > in.
| > |
| > | Lance Johnson
| > |
| > |
| > | "Jeffrey Tan[MSFT]" <v-*****@online.mi crosoft.com> wrote in message
| > | news:ui******** ******@cpmsftng xa06.phx.gbl...
| > | >
| > | > Hi Lance,
| > | >
| > | > I think you should inherit a new class from your control and custom
| some
| > | > methods
| > | > to your control(such as release lock).
| > | > Then, in the SelectedIndexCh anged event, you can record the last
| > invisable
| > | > tab index
| > | > and invoke all the related method of the controls in that tab page.
| > | > If I still misunderstand you, please do not be hesitated to tell me.
| > | >
| > | > Best regards,
| > | > Jeffrey Tan
| > | > Microsoft Online Partner Support
| > | > Get Secure! -
www.microsoft.com/security
| > | > This posting is provided "as is" with no warranties and confers no
| > rights.
| > | >
| > | > --------------------
| > | > | From: "Lance Johnson" <lj******@docs. com>
| > | > | References: <uJ************ *@TK2MSFTNGP09. phx.gbl>
| > | > <#7************ *@TK2MSFTNGP10. phx.gbl>
| > | > <ux************ *@TK2MSFTNGP10. phx.gbl>
| > <bi**********@t itan.btinternet .com>
| > | > | Subject: Re: tab control and tab changed
| > | > | Date: Tue, 26 Aug 2003 16:09:42 -0500
| > | > | Lines: 31
| > | > | X-Priority: 3
| > | > | X-MSMail-Priority: Normal
| > | > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | > | Message-ID: <#h************ **@TK2MSFTNGP09 .phx.gbl>
| > | > | Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
| > | > | NNTP-Posting-Host: 204.95.153.41
| > | > | Path:
cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP09.phx.g bl
| > | > | Xref: cpmsftngxa06.ph x.gbl
| > | microsoft.publi c.dotnet.langua ges.csharp:1800 48
| > | > | X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
| > | > |
| > | > | I could do that, however what could I call that would allow the
| > control
| > | to
| > | > | know it's not visible any more. If I set control.visible to false
| > that
| > | > does
| > | > | nothing, because it's already set to false. That's my #1 problem
is
| > | that
| > | > | it's visibility gets set to false without the event occurring.
| > | > |
| > | > | Lance Johnson
| > | > |
| > | > | "Paul E Collins" <fi************ ******@CL4.org> wrote in message
| > | > | news:bi******** **@titan.btinte rnet.com...
| > | > | > "Lance Johnson" <lj******@docs. com> wrote:
| > | > | >
| > | > | > > > Use TabControl.Sele ctedIndexChange d event.
| > | > | > >
| > | > | > > I'm well aware of that event, however that does me
| > | > | > > no good for notifying my client controls for the
| > | > | > > previous tab. I'd rather not use the workaround of
| > | > | > > remembering the last tab page manually.
| > | > | >
| > | > | > When SelectedIndexCh anged occurs, you could use a foreach
| statement
| > to
| > | > | > iterate over the TabPages in your TabControl and disable the
| > controls
| > | on
| > | > | any
| > | > | > TabPage that isn't the currently selected one.
| > | > | >
| > | > | > P.
| > | > | >
| > | > | > --
| > | > | >
www.CL4.org
| > | > | >
| > | > | >
| > | > |
| > | > |
| > | > |
| > | >
| > |
| > |
| > |
| >
|
|
|