PC Review


Reply
Thread Tools Rate Thread

cancel change in tab selected

 
 
dennist
Guest
Posts: n/a
 
      15th Aug 2003
Is there an event in which I can cancel a change in the
tab selected. I just spent a half-hour with the
documentation and couldn't figure it out.

I must say that the help in vs.net is less direct and
practical than the help in vs6.

Do I have to go to a third party product, such as
infragistics, in order to get this rather basic and
crucial choice? I hope not.

dennist
 
Reply With Quote
 
 
 
 
Ying-Shen Yu
Guest
Posts: n/a
 
      15th Aug 2003
Hi dennist,
I've also searched the documention, to my knowledge,I'm afraid the tab
page control doesn't provide this feature,
perhaps, you may handle all the ???Changed (TextChanged, ValueChanged etc)
events in your tab page, and save these values by your self, Please let me
konw, if you still have problem ,thanks!
Kind regards,

Ying-Shen Yu [MSFT]
Microsoft Support Engineer

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. 2001 Microsoft Corporation. All rights
reserved.
--------------------
| Content-Class: urn:content-classes:message
| From: "dennist" <(E-Mail Removed)>
| Sender: "dennist" <(E-Mail Removed)>
| Subject: cancel change in tab selected
| Date: Fri, 15 Aug 2003 02:30:38 -0700
| Lines: 12
| Message-ID: <082e01c3630f$e33beb40$(E-Mail Removed)>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcNjD+M7Wklfh0f5QO+Htrbi/CFicw==
| Newsgroups: microsoft.public.dotnet.framework.windowsforms
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.windowsforms:50339
| NNTP-Posting-Host: TK2MSFTNGXA13 10.40.1.165
| X-Tomcat-NG: microsoft.public.dotnet.framework.windowsforms
|
| Is there an event in which I can cancel a change in the
| tab selected. I just spent a half-hour with the
| documentation and couldn't figure it out.
|
| I must say that the help in vs.net is less direct and
| practical than the help in vs6.
|
| Do I have to go to a third party product, such as
| infragistics, in order to get this rather basic and
| crucial choice? I hope not.
|
| dennist
|

 
Reply With Quote
 
Claes Bergefall
Guest
Posts: n/a
 
      18th Aug 2003
The Win32 control provides a notification for this
but it isn't exposed through .NET. You'll need
to override TabControl to handle it. Try this:

Imports System.Runtime.InteropServices
Public Class TabControlEx
Inherits TabControl

Public Const TCN_FIRST As Integer = 0 - 550
Public Const TCN_SELCHANGING As Integer = TCN_FIRST - 2
Public Const WM_USER As Integer = &H400
Public Const OCM__BASE As Integer = WM_USER + &H1C00
Public Const OCM_NOTIFY As Integer = OCM__BASE + WM_NOTIFY

<StructLayout(LayoutKind.Sequential)> Public Structure NMHDR
Public hwndFrom As IntPtr
Public idFrom As Integer
Public code As Integer
End Structure

Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
If m.Msg = OCM_NOTIFY Then
Dim nm As NMHDR = CType(m.GetLParam(GetType(NMHDR)), NMHDR)
If nm.code = TCN_SELCHANGING Then
Dim e As New System.ComponentModel.CancelEventArgs()
RaiseEvent SelectedIndexChanging(Me, e)
m.Result = New System.IntPtr(Convert.ToInt32(e.Cancel))
Exit Sub
End If
End If
MyBase.WndProc(m)
End Sub

Public Event SelectedIndexChanging(ByVal sender As Object, ByVal e As
System.ComponentModel.CancelEventArgs)
End Class

/claes



"dennist" <(E-Mail Removed)> wrote in message
news:082e01c3630f$e33beb40$(E-Mail Removed)...
> Is there an event in which I can cancel a change in the
> tab selected. I just spent a half-hour with the
> documentation and couldn't figure it out.
>
> I must say that the help in vs.net is less direct and
> practical than the help in vs6.
>
> Do I have to go to a third party product, such as
> infragistics, in order to get this rather basic and
> crucial choice? I hope not.
>
> dennist



 
Reply With Quote
 
Steven J. Reed
Guest
Posts: n/a
 
      21st Aug 2003
What is the value of WM_NOTIFY?

>-----Original Message-----
>The Win32 control provides a notification for this
>but it isn't exposed through .NET. You'll need
>to override TabControl to handle it. Try this:
>
>Imports System.Runtime.InteropServices
>Public Class TabControlEx
> Inherits TabControl
>
> Public Const TCN_FIRST As Integer = 0 - 550
> Public Const TCN_SELCHANGING As Integer = TCN_FIRST -

2
> Public Const WM_USER As Integer = &H400
> Public Const OCM__BASE As Integer = WM_USER + &H1C00
> Public Const OCM_NOTIFY As Integer = OCM__BASE +

WM_NOTIFY
>
> <StructLayout(LayoutKind.Sequential)> Public

Structure NMHDR
> Public hwndFrom As IntPtr
> Public idFrom As Integer
> Public code As Integer
> End Structure
>
> Protected Overrides Sub WndProc(ByRef m As

System.Windows.Forms.Message)
> If m.Msg = OCM_NOTIFY Then
> Dim nm As NMHDR = CType(m.GetLParam(GetType

(NMHDR)), NMHDR)
> If nm.code = TCN_SELCHANGING Then
> Dim e As New

System.ComponentModel.CancelEventArgs()
> RaiseEvent SelectedIndexChanging(Me, e)
> m.Result = New System.IntPtr

(Convert.ToInt32(e.Cancel))
> Exit Sub
> End If
> End If
> MyBase.WndProc(m)
> End Sub
>
> Public Event SelectedIndexChanging(ByVal sender As

Object, ByVal e As
>System.ComponentModel.CancelEventArgs)
>End Class
>
> /claes
>
>
>
>"dennist" <(E-Mail Removed)> wrote in message
>news:082e01c3630f$e33beb40$(E-Mail Removed)...
>> Is there an event in which I can cancel a change in the
>> tab selected. I just spent a half-hour with the
>> documentation and couldn't figure it out.
>>
>> I must say that the help in vs.net is less direct and
>> practical than the help in vs6.
>>
>> Do I have to go to a third party product, such as
>> infragistics, in order to get this rather basic and
>> crucial choice? I hope not.
>>
>> dennist

>
>
>.
>

 
Reply With Quote
 
Ying-Shen Yu[MSFT]
Guest
Posts: n/a
 
      22nd Aug 2003
Hi Steven,
//winuser.h
#define WM_NOTIFY 0x004E
Thanks for using microsoft online support !

Kind regards,

Ying-Shen Yu [MSFT]
Microsoft Support Engineer

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. 2001 Microsoft Corporation. All rights
reserved.
--------------------
| Content-Class: urn:content-classes:message
| From: "Steven J. Reed" <(E-Mail Removed)>
| Sender: "Steven J. Reed" <(E-Mail Removed)>
| References: <082e01c3630f$e33beb40$(E-Mail Removed)>
<#(E-Mail Removed)>
| Subject: Re: cancel change in tab selected
| Date: Thu, 21 Aug 2003 14:58:57 -0700
| Lines: 70
| Message-ID: <241e01c3682f$6bdaf850$(E-Mail Removed)>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcNoL2valCrkqvmEQ/yXJftQee4scQ==
| Newsgroups: microsoft.public.dotnet.framework.windowsforms
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.windowsforms:50732
| NNTP-Posting-Host: TK2MSFTNGXA06 10.40.1.53
| X-Tomcat-NG: microsoft.public.dotnet.framework.windowsforms
|
| What is the value of WM_NOTIFY?
|
| >-----Original Message-----
| >The Win32 control provides a notification for this
| >but it isn't exposed through .NET. You'll need
| >to override TabControl to handle it. Try this:
| >
| >Imports System.Runtime.InteropServices
| >Public Class TabControlEx
| > Inherits TabControl
| >
| > Public Const TCN_FIRST As Integer = 0 - 550
| > Public Const TCN_SELCHANGING As Integer = TCN_FIRST -
| 2
| > Public Const WM_USER As Integer = &H400
| > Public Const OCM__BASE As Integer = WM_USER + &H1C00
| > Public Const OCM_NOTIFY As Integer = OCM__BASE +
| WM_NOTIFY
| >
| > <StructLayout(LayoutKind.Sequential)> Public
| Structure NMHDR
| > Public hwndFrom As IntPtr
| > Public idFrom As Integer
| > Public code As Integer
| > End Structure
| >
| > Protected Overrides Sub WndProc(ByRef m As
| System.Windows.Forms.Message)
| > If m.Msg = OCM_NOTIFY Then
| > Dim nm As NMHDR = CType(m.GetLParam(GetType
| (NMHDR)), NMHDR)
| > If nm.code = TCN_SELCHANGING Then
| > Dim e As New
| System.ComponentModel.CancelEventArgs()
| > RaiseEvent SelectedIndexChanging(Me, e)
| > m.Result = New System.IntPtr
| (Convert.ToInt32(e.Cancel))
| > Exit Sub
| > End If
| > End If
| > MyBase.WndProc(m)
| > End Sub
| >
| > Public Event SelectedIndexChanging(ByVal sender As
| Object, ByVal e As
| >System.ComponentModel.CancelEventArgs)
| >End Class
| >
| > /claes
| >
| >
| >
| >"dennist" <(E-Mail Removed)> wrote in message
| >news:082e01c3630f$e33beb40$(E-Mail Removed)...
| >> Is there an event in which I can cancel a change in the
| >> tab selected. I just spent a half-hour with the
| >> documentation and couldn't figure it out.
| >>
| >> I must say that the help in vs.net is less direct and
| >> practical than the help in vs6.
| >>
| >> Do I have to go to a third party product, such as
| >> infragistics, in order to get this rather basic and
| >> crucial choice? I hope not.
| >>
| >> dennist
| >
| >
| >.
| >
|

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code in Form to Change all Selected Records & Save Them Then Uncheck Selected Cory Microsoft Access VBA Modules 0 4th Dec 2007 04:18 PM
Cancel Record Change =?Utf-8?B?QnJhZA==?= Microsoft Access Form Coding 2 10th Jul 2007 03:04 PM
Selected cancel in middle of copying folder. Lost documents? =?Utf-8?B?Q0xN?= Microsoft Word Document Management 1 9th Dec 2005 07:15 PM
Re: Cancel the orientation change Daniel Moth Microsoft Dot NET Compact Framework 0 18th Nov 2005 10:48 PM
Check to see if OK or CANCEL selected using wlib_AutoDial =?Utf-8?B?R3V5IEtlcnI=?= Microsoft Access VBA Modules 0 16th Dec 2004 07:35 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:41 AM.