473,385 Members | 1,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Delegation question ?

Hi
I have a form, it has a button and a control I made.
The control has its own functions.
I want to delegate a keystroke on the control to a button in the main form.
Meaning, a function in the control will trigger a function in the form.
it's not a static function, and the form is not a singleton. is there a way
to it ?
10x.
Apr 4 '06 #1
2 1325
VJ
you are on the right path... use delegates to inform the Parent control, i.e
in your case the Form , and in that execute your Form code..., so
delegates/events is the way to go. There is no singleton or static functions
here..

VJ

"Nadav" <na****@gmail.com> wrote in message
news:O2**************@TK2MSFTNGP09.phx.gbl...
Hi
I have a form, it has a button and a control I made.
The control has its own functions.
I want to delegate a keystroke on the control to a button in the main
form.
Meaning, a function in the control will trigger a function in the form.
it's not a static function, and the form is not a singleton. is there a
way
to it ?
10x.

Apr 4 '06 #2
Nadav,

Have you looked at the KeyPreview property on the Form class? Setting
this will allow the form to process key strokes before the events are passed
to the control/window on the form that it is intended for.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Nadav" <na****@gmail.com> wrote in message
news:O2**************@TK2MSFTNGP09.phx.gbl...
Hi
I have a form, it has a button and a control I made.
The control has its own functions.
I want to delegate a keystroke on the control to a button in the main
form.
Meaning, a function in the control will trigger a function in the form.
it's not a static function, and the form is not a singleton. is there a
way
to it ?
10x.

Apr 4 '06 #3

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

Similar topics

7
by: Rene Pijlman | last post by:
Section 6.5 "What is delegation?" of the FAQ says: "Python programmers can easily implement delegation. For example, the following class implements a class that behaves like a file but converts...
3
by: Jacob | last post by:
Hello All, I am trying to serve out some content via IIS that is hosted on a remote fileserver, and am unable to get the delegation working correctly. Our setup is as follows: Local LAN...
6
by: DPfan | last post by:
Is the following so-called "delegation"? If not how to make some changes so that the F class delegates its operation to an E instance. On the other hand the following code runs without any...
3
by: Tony Johansson | last post by:
Hello! What does it mean with delegation and can you give me one example. //Tony
2
by: | last post by:
Hi, I am working on a n-tier app using remoting. I am using the VS 2005 beta 2. My server needs to access a remote resources on behalf on the connected user. I have configured my server like :...
2
by: russell.lane | last post by:
I'm building out a pretty standard n-tier web application. The stack includes application/presentation, biz logic, and data access layers on top of an SQL server back end. We want to use...
4
by: JimLad | last post by:
In advance, sorry if this is the wrong group... SQL Server 2000 SP3 on Server 2003. SQL Account and Computer both Trusted for Delegation. Given SPN. IIS 5.0 on W2000. Kerberos enabled....
6
by: Marc Castrechini | last post by:
This is a classic double hop delegation issue, however its the first time we are setting this up so we are doing something incorrectly. If we run through the IDE or using a localhost path on the...
3
by: Patrick | last post by:
Hello I have the following scenario - SQL 2005 server (serversql) - Windows 2003 with IIS (serveriis) - Windows 2003 ADS (serverads) I want to connect to an intranet application using NTML...
5
by: =?Utf-8?B?TWF5ZXI=?= | last post by:
Hi, I'm using two form classes and I would like all methods of the second class (the child class) to be managed by the first class (the main class). Is delegation the best solution for me? If so,...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.