473,763 Members | 8,980 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

tab control and tab changed

I would like for when a tab page changes, that my controls on the previous
tab page would receive a visiblechanged event or some other event so they
are aware of that. We have db locks in some of our controls when they're
visible and so if a tab page is changed, I would like for the control to
know it's no longer visible and release that lock. Currently that doesn't
happen. Does anybody have any suggestions and/or is this a bug?

Lance Johnson
Nov 15 '05 #1
9 7975
Use TabControl.Sele ctedIndexChange d event.

"Lance Johnson" <lj******@docs. com> wrote in message
news:uJ******** *****@TK2MSFTNG P09.phx.gbl...
I would like for when a tab page changes, that my controls on the previous
tab page would receive a visiblechanged event or some other event so they
are aware of that. We have db locks in some of our controls when they're
visible and so if a tab page is changed, I would like for the control to
know it's no longer visible and release that lock. Currently that doesn't
happen. Does anybody have any suggestions and/or is this a bug?

Lance Johnson

Nov 15 '05 #2
"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
Nov 15 '05 #3

Hi Lance,

In SelectedIndexCh anged event, you can only get the current selected tab
index.
I think you should get the original tab before changing, then you can loop
through the
controls in the original tab and invoke its related method.

To get the original tab, you can set a static variable to store the
original tab index(at startup its value should be 0).

To loop through the controls on the tab, you can do like this:

foreach(Control c in tabControl1.Tab Pages[origtabindex].Controls)
{
//invoke your method of the control
}

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>
| Subject: Re: tab control and tab changed
| Date: Tue, 26 Aug 2003 15:25:14 -0500
| Lines: 33
| 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: <ux************ *@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:1796 32
| X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
|
| 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 my client controls are
hidden
| that event should be thrown, which it's not being thrown. As a side note
| I've built in an event handler on my control that attaches to the parent's
| visible changed event so it'll know to hide itself.
|
| Lance Johnson
|
| "Val Savvateev" <vs********@mer idium.com_NO_SP AM> wrote in message
| news:%2******** *******@TK2MSFT NGP10.phx.gbl.. .
| > Use TabControl.Sele ctedIndexChange d event.
| >
| > "Lance Johnson" <lj******@docs. com> wrote in message
| > news:uJ******** *****@TK2MSFTNG P09.phx.gbl...
| > > I would like for when a tab page changes, that my controls on the
| previous
| > > tab page would receive a visiblechanged event or some other event so
| they
| > > are aware of that. We have db locks in some of our controls when
| they're
| > > visible and so if a tab page is changed, I would like for the control
to
| > > know it's no longer visible and release that lock. Currently that
| doesn't
| > > happen. Does anybody have any suggestions and/or is this a bug?
| > >
| > > Lance Johnson
| > >
| > >
| >
| >
|
|
|

Nov 15 '05 #4
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

Nov 15 '05 #5

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
| >
| >
|
|
|

Nov 15 '05 #6
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
| >
| >
|
|
|

Nov 15 '05 #7

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
| > | >
| > | >
| > |
| > |
| > |
| >
|
|
|

Nov 15 '05 #8
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
| > | >
| > | >
| > |
| > |
| > |
| >
|
|
|

Nov 15 '05 #9

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
| > | > | >
| > | > | >
| > | > |
| > | > |
| > | > |
| > | >
| > |
| > |
| > |
| >
|
|
|

Nov 15 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1767
by: Joe Loyd | last post by:
I have a Web form made up of several panels of controls. On postback, I need to detect if any of the controls were updated. Is there something like a "Panel.Changed" event or am I stuck iterating through the control collection? Thanks in advance for any help...
0
2233
by: Steven | last post by:
Hi, I'm creating a custom checkbox list control which will take 2 arraylists as input. (One will contain Names and other will contain 0s and 1s. 0 - uncheck 1- check). I'm able to create the checkbox list. The problem is I'm unable to raise an event when I select any of the checkboxes. Following is the code: Could you guys please help me on this issue.
6
6671
by: Tom Rowton | last post by:
This one has me a bit confused and I'm not finding what I need in the MSDN or by searching these forums, so here goes... I have a rather large, complex code-in-page WebForm (don't ask) and a section of that Form is 4 or 5 ASP:Panels pretending to be a set of Tabs, each with its own section of the form.
2
2885
by: Tascien | last post by:
Guys, I am trying to run through the page controls, if the controls' id is found in the database, then I change the corresponding text from the database. but, the system is coming back with error: BC30456: 'Text' is not a member of 'System.Web.UI.Control'. how. I am sure the label control has a text property.
2
3628
by: John Lau | last post by:
Hi, Is there documentation that talks about the page lifecycle, the lifecycle of controls on the page, and the rendering of inline code, in a single document? Thanks, John
4
1706
by: Neil Stevens | last post by:
Hi, Merry Christmas to you all. I have a problem with server controls, i am writing a C# ASP.NET web project and i am creating custom server controls for some of the more common element. One example is a NavigationMenu control or a Login control. The problem is that when the page renders, say, the Login control, the ID of the username field is changed from
4
2598
by: louise raisbeck | last post by:
Hi I know there are many posts on this but cant seem to find simple answer. I have lots of text boxes in a datalist edittemplate control. i dont want to do an update statement for all of them, as the user may only change one value. I know you can use viewstate to check if value has changed between last postback and what is currently in the Text property (can I?). So, is this correct syntax (focusing on the viewstate line)?? foreach...
3
1411
by: epigram | last post by:
I've tried asking this question several times and have received many good answers, but ones that don't quite answer my question. This leads me to believe that I am trying to do something very awkward or I don't know how to pose the question correctly. Let me try again. I appreciate any input! :-) I have an asp.net web form with a TextBox control and a submit button. The TextBox control's text property is set on the server before it...
11
11577
by: John J. Hughes II | last post by:
I have a DataGridView displaying data from a DataSet. To the right of that I have a custom user control which displays one of the data set fields. The custom user control is bound to the data set object and displays the data correctly when I move from row to row. The problem I am having is the data set always reads the data back and considers it change even when it's not. I am looking for how to change the following code so the...
0
9564
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10002
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8822
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7368
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6643
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5270
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5406
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3917
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3528
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.