473,654 Members | 3,108 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

key events in a winforms custom control class

1 New Member
I've been building my own nullable and bindable datetimepicker class, which inherits from DateTimePicker and includes a textbox to handle any user text entry, blanking the date for null, and such. Works great and handles all my needs just fine, except for one thing: key events when the calendar is dropped down. I wanted to capture the Enter key (which would set the control value to the dtp value; and the Escape key (which would leave the control value unchanged). I'm doing all the synchronization work between Mybase.Value and the control's value at the CloseUp event and figured it would be no sweat to intercept the key events and set some flags to whatever I wanted. But no go. I've tried 'em all, from PreviewKeyDown to ProcessCmdKey and everything in between, and I never get one before Closeup. I'm sure I'm missing something simple, but have no idea what.
Dec 12 '14 #1
0 1102

Sign in to post your reply or Sign up for a free account.

Similar topics

1
4867
by: Caronte | last post by:
Hi all, I have a problem using Custom control class inside a DLL Extension. My Custom control use Class property to specify the register class name for the control. Both Dialog Class and Custom control class are inside the dll. When i run the application i can't view the dialog and Vc++ display an error on ShowWindow procedure.
0
1622
by: keith | last post by:
I created a custom control class which inherted from another control class in C#. The another control referenced another assembly. I put the custom control into toolbox and drew it into a form in .NET window app in C#. When compiled the window app, I got error that said I needed to reference an assembly referenced in the base class.
3
10831
by: Joe Bloggs | last post by:
Does anyone know if its possible to pass parameters or the values of Request.QueryString from a web page to a custom control class? I'm using a C# Web Application. For Example I have Web Page1 which has to parameters passed to it from another Web page Parameter # 1 dbid and Parameter # 2 reportid. I know that I can access the values of the parameters from the code behind .aspx.cs using Request.QueryString so
3
1690
by: TIBM | last post by:
Hi. I'm not getting any answers in buildingcontrols, so I'm gonna try here. I've written a custom control derived from System.Web.UI.WebControls.ListControl. The control is taking in a dataset and renders HTML with radio buttons (the result is similar to a RadioButtonList). I would like to add events to the control, but being new to .NET I don't know where to start. When the user changes selection by clicking another radio button, I would...
19
4906
by: Jamey Shuemaker | last post by:
I'm in the process of expanding my knowledge and use of Class Modules. I've perused MSDN and this and other sites, and I'm pretty comfortable with my understanding of Class Modules with the exception of custom Collection Classes. Background: I'm developing an A2K .mdb to be deployed as an .mde at my current job-site. It has several custom controls which utilize custom classes to wrap built-in controls, and add additional functionality....
9
5116
by: Rob | last post by:
When a custom control is used within a form, that control does not get events directly. I've run into this a couple times with both mouse and keyboard events. Ex: A custom control inherits from UserControl (or Panel, etc). If that particular control is being edited, it IS possible to assign handlers and get events. However, when the control is used on the main form, assigning a handler to the particular control does nothing--the...
15
6505
by: rizwanahmed24 | last post by:
Hello i have made a custom control. i have placed a panel on it. I want this panel to behave just like the normal panel. The problem i was having is that the panel on my custom control doesnt accept other controls. The control i drag drop on it becomes the child of my custom control's parent form and not the child of my custom control. Then i added this line "" before my custom control class (i dont know what this line does). Now
1
3004
by: --== Alain ==-- | last post by:
Hi, I still have problem updating my custom control at design time. When i change a property of my custom control in the property window, i would like to see this change immediately on my custom control at the design time. Unfortunately, my custom control does not refresh at design time when a property is changed.
2
1308
by: PR | last post by:
Hello, I'm creating a Windows control that includes a few textboxes. In the form designer, I want there to be one property that drops down into a few sub-values for the different text boxes, somewhat akin to how Location and Size usually work for many standard controls. (There may be more appropriate ways to do this, but I'm kind of doing it as a self-tutorial.)
1
5249
by: JTC^..^ | last post by:
When I create a custom control inside my Windows Application project it does not appear in the toolbox. I'm using Visual Studio 2005 (Team System for Developers), so this should appear automatically, right? I've compiled the application and selected show all items, but the controls do not appear. If I create an external Windows Control library and import the controls they appear. I also tried resetting the toolbox, then creating a new...
0
8372
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
8814
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
7304
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
6160
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
5621
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
4149
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
4293
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2709
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
1
1915
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.