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" <
[email protected]>
| Sender: "Steven J. Reed" <
[email protected]>
| References: <
[email protected]>
<#
[email protected]>
| Subject: Re: cancel change in tab selected
| Date: Thu, 21 Aug 2003 14:58:57 -0700
| Lines: 70
| Message-ID: <
[email protected]>
| 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
| >
| >
| >
| >| >> 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
| >
| >
| >.
| >
|