473,756 Members | 9,662 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can't override Tab selection.

Hi,

I am using a custom text box, where I need to override TabSelection, as I
have to generate an event and based on that event, I need to do some
processing in other class, who is listening to that event. This thing works
fine, when I am stopping in the debugger for the event, but as soon as I
remove the breakpoint from the event handler method. This doesn't work and
even the release version of the software also doesn't work.
Following is a snippet of the code :-

public class TypeTextBox : System.Windows. Forms.TextBox
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.Componen tModel.Containe r components = null;
public delegate void TabSelectedDele gate(object sender,EventArg s e);
public event TabSelectedDele gate TabSelected;

protected override bool ProcessCmdKey(r ef Message msg, Keys keyData)
{
const int WM_KEYDOWN = 0x100;
const int WM_SYSKEYDOWN = 0x104;
System.EventArg s e = new EventArgs();
if ((msg.Msg == WM_KEYDOWN) || (msg.Msg == WM_SYSKEYDOWN))
{
if (keyData == Keys.Tab)
{
textcolor = Color.DarkGreen ;
TabSelected(thi s,e);
}
}
this.TabStop = false;
keyData = Keys.None;
base.TabIndex = 0;
base.TabStop = false;
return base.ProcessCmd Key(ref msg,keyData);
}
}

}

public class PicturePlacemen t : System.Windows. Forms.UserContr ol
{

private TypeTextBox myTextBox;

private void SubscribeTabSel ected(TypeTextB ox localTextBox)
{
localTextBox.Ta bSelected +=
new TypeTextBox.Tab SelectedDelegat e(TabSelectDone );

}
private void TabSelectDone(o bject localTextBox,Ev entArgs e)
{

// Do something here..

}

Any idea would be appreciated.

Thanks,

-Brajesh

Nov 16 '05 #1
0 1099

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

Similar topics

15
3323
by: lawrence | last post by:
Is this the correct way to test for a method before I use it? createRange() is, I believe, an IE only method. function wrapSelectionInTag(selection, tag) { if (document.selection.createRange) { var range = document.selection.createRange(); if (range.parentElement() == element) range.text = '<' + tag + '>' + range.text + '<\/' + tag + '>'; }
2
2466
by: kimimaro | last post by:
hi I wonder if array can be work along with structure? Below are the declaration of my structure struct employee{ char ID; char Name; char Department;
1
3383
by: MrNobody | last post by:
Is it at all possible to override the default behavior of a DataGrid when the mouse is clicked on a row? I am having a problem where I am trying to select multiple rows in a DataGrid by left-clicking them, but each time I click another row to add it to the selection the previously added row loses it's highlighting, so it appears as though only one row is selected at any one time.
59
3461
by: Michael C | last post by:
eg void DoIt() { int i = FromString("1"); double d = FromString("1.1"); } int FromString(string SomeValue) {
1
2234
by: Serdge Kooleman | last post by:
WinForms, how to override/avoide the tab order for a bunch of buttons/textboxes? i have a panel with 4 textboxes (or buttons) in 2 comlumns (so 2 and 2) i would like to scroll in the first column when i'm pressing arrow button "down" and go to the right column, the same row when i'm pressing button "right" or "tab". if i press "tab" second time selection should go left, to the same row (now
3
9834
by: Sushil Srivastava | last post by:
Hi Guys, Would you be able to help me using C# GUI (with user interface component) in my MFC application. I have used managed extension, COM-interops, etc but problem is this C# component has user interface. how should have get window handle from managed windows? Thanks in advance. Sushil
2
1287
by: jw56578 | last post by:
is there a way to automatically generate properties from fields in vs.net
4
11337
by: Abdhul Saleem | last post by:
Hi, I am recieving error ActiveX component can't create object in the following line in the asp page. set ExcelApp = CreateObject("Excel.Application") Previously this code was working fine. Thanks in advance.
4
12440
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is this: can Access create the document and place it as an OLE object to the relevant table? Any help is greatly appreciated. Ricky
0
9292
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9901
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...
1
9878
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9728
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7282
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
5167
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
5322
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3827
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
3392
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.