473,467 Members | 1,575 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Sender As Textbox

maheshwag
71 New Member
what is the meaning of (textbox)sender yeah! it is casting of it. I have seen in many example but don't know it's meaning and usages.

please guide me in details with example.

thx

am practicing in C# , VS-2005
Sep 7 '10 #1

✓ answered by MartijnHoekstra

Sender is by default of type object.
Textbox is derived from Object.
But Textbox contains more methods and properties than object does.
When you 'cast' the 'object sender' to the type 'textbox', while knowing it must be a textbox, you will be able to use all textbox'es methods and properties once more.

So why not put 'textbox sender' in first place?
That is because the event, or handler is not part of textbox, but part of 'object'

4 6675
MartijnHoekstra
39 New Member
Sender is by default of type object.
Textbox is derived from Object.
But Textbox contains more methods and properties than object does.
When you 'cast' the 'object sender' to the type 'textbox', while knowing it must be a textbox, you will be able to use all textbox'es methods and properties once more.

So why not put 'textbox sender' in first place?
That is because the event, or handler is not part of textbox, but part of 'object'
Sep 7 '10 #2
maheshwag
71 New Member
So the Textbox is not an object?
Sep 7 '10 #3
maheshwag
71 New Member
what is an object.?
Sep 7 '10 #4
maheshwag
71 New Member
sir, don't feel bad, but it's for my knowledge.
Sep 7 '10 #5

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

Similar topics

3
by: Marty | last post by:
Hi, I have this event that is performed by three different controls, how can I know (from sender object) wich control is used to trigger the event? Private Sub HighlightSelectedRow(ByVal...
7
by: Woody Splawn | last post by:
It is hard for me to imagine a time when you would not want to have the data in a textbox control trimmed. I am hoping there is some sort of switch that can be set for all text boxes so that when...
12
by: Peter | last post by:
I'm looking to create multiple textboxs that change to a light blue on focus. What is the most efficient way to do this? -Peter
2
by: Peter | last post by:
I hate using the mask edit conrol so I created these two function to format my phone numbers. Is there a way to consolidate these two functions into one? In this example say the textbox you...
4
by: Woody Splawn | last post by:
I would like to be able to know if the user has pressed a key in any text box on a winform or in other words, if he is editing a record. I would like to know this as soon as he presses any key. I...
2
by: barry | last post by:
I am using the following code in a textbox: Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged Dim txt As TextBox =...
3
by: Alan LeHun | last post by:
I want to attach a context menu to multiple textboxes but I don't know how the extract the name of the textbox that is the subject of the event. I can't seem to do anything with "sender as...
14
by: teddysnips | last post by:
WINDOWS FORMS I've a form that has a textbox that allows the user to enter a string. On the LostFocus event, the textbox formats the string into a preferred format. However, if the user...
0
by: andytsummers | last post by:
Hi I have tried to implement drag and drop by using the following code but I have several problems. 1. When you put your mouse over selected text the cursor is still the i-beam and therefore...
2
by: lmefford | last post by:
Is there a way to modify all textboxes on a form so that when you click on any of them you process the SelectAll() function. For exaple, let's say I've created a form with 30 textboxes. These...
0
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...
0
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,...
1
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...
0
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...
0
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,...
0
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...
0
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...
0
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...
0
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 ...

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.