473,387 Members | 3,781 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,387 software developers and data experts.

Friend WithEvents

JJ
Hi All

I came across this piece of code in C# and was wondering what exactly does it mean to the event

Friend WithEvents txtPath As System.Windows.Forms.TextBo

The Friend Withevents part

Thanks

JJ
Nov 15 '05 #1
2 4717
"JJ" <an*******@discussions.microsoft.com> wrote in message
news:69**********************************@microsof t.com...
I came across this piece of code in C# and was wondering what exactly does it mean to the event?
Friend WithEvents txtPath As System.Windows.Forms.TextBox


It means that it is a piece of VB code.

--
Mickey Williams
Author, "Microsoft Visual C# .NET Core Reference", MS Press
www.servergeek.com
Nov 15 '05 #2
JJ,

This is a piece of VB code. Basically, what it does is wire up the
events from the textbox automatically if the appropriate methods are
declared.

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

"JJ" <an*******@discussions.microsoft.com> wrote in message
news:69**********************************@microsof t.com...
Hi All,

I came across this piece of code in C# and was wondering what exactly does it mean to the event?
Friend WithEvents txtPath As System.Windows.Forms.TextBox

The Friend Withevents part.

Thanks,

JJ

Nov 15 '05 #3

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

Similar topics

7
by: Jonas | last post by:
This works fine in Win XP but does not work at all in Win 98. Private WithEvents objIExplorer As InternetExplorer I have to do it like this to get it to work in Win 98 Dim objIExplorer As...
2
by: Jakob Bengtsson | last post by:
Hi, I have a form (which cannot be serialized). In the form's code I declare an object like this (never mind the object nor class name, it's for illustration only): Private WithEvents...
5
by: Bradley Grant | last post by:
I am trying to write a program to access a device through USB port, there is some Visual Basic program examples that work with the device, but I am trying to write a program using C#, no luck yet,...
4
by: Tee | last post by:
Hi, I am converting a code from VB to C#. in VB, it's Private WithEvents MyButton As Button what's the code in C# ? I can't get the replacement for the "WithEvents" in C#.
2
by: Peter | last post by:
Hello, Thanks for reviewing my question. I am following KB article about creating a custom control and its source code is in VB. I got to a part where I have the following: Private...
0
by: Steve | last post by:
Hello, I have been experimenting/learning to use aspx with and without VS2003. In VS 2003 I created a simple webform/application which contains a listbox and a label. I populate the listbox...
4
by: Shapper | last post by:
Hello, I have an aspx.vb page with this code: Public Class WebForm1 Inherits System.Web.UI.Page Protected WithEvents Menu1 As MenuControl.Web.UI.Menu ... If I have my code in the aspx...
6
by: | last post by:
Is there any additional overhead for declaring a variable using the WithEvents keyword even if none of the events are being handled?
8
by: Bob Day | last post by:
Using VS 2003, VB.NET, MSDE If an event is raised in a class that was NOT instantiated with the WithEvents key word, is that event effectively ignored? Or, another way to phrase the question,...
3
by: hartley_aaron | last post by:
Hi, What does it mean when VS automatically adds a line like this to code of my form: Friend WithEvents Label1 As System.Windows.Forms.Label Also, I noticed a modifier property for each...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
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
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...

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.