473,408 Members | 2,405 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,408 software developers and data experts.

Event visibility

An elementary question I know, but I've just realised that I don't
know the answer:

I want to use the FileSystemWatcher component. Its only obvious way
of use is to add this to a form. (Maybe there is a way of adding it to
a non-form class?). But I want to handle the FSW event in a non-form
class. But despite having reset its scope from Friend to Public (maybe
Friend is the right choice anyhow?) the FSW events don't appear on the
dropdown list of other classes. What do I need to do please?

TIA
JGD
Nov 21 '05 #1
1 930
Hi,

Declare the variable withevents to have access to the events

Public Class MyFileWatcherClass

Private WithEvents fsw As New System.IO.FileSystemWatcher("C:\Temp")

End Class

Ken

---------------------------

"John Dann" <ne**@prodata.co.uk> wrote in message
news:3g********************************@4ax.com...
An elementary question I know, but I've just realised that I don't
know the answer:

I want to use the FileSystemWatcher component. Its only obvious way
of use is to add this to a form. (Maybe there is a way of adding it to
a non-form class?). But I want to handle the FSW event in a non-form
class. But despite having reset its scope from Friend to Public (maybe
Friend is the right choice anyhow?) the FSW events don't appear on the
dropdown list of other classes. What do I need to do please?

TIA
JGD
Nov 21 '05 #2

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

Similar topics

4
by: Bob | last post by:
Below is sample code that illustrates what I'm trying to do. For sake of brevity I didn't include the properties of buildBtn that determine what data to request. The problem is I never see...
4
by: David | last post by:
Greeting All: Time to pick the collective brain cell again. I have a web page that adds options to a select box on the fly. What I need to do is set the onDblClick event the same way. I need...
2
by: webdev | last post by:
I'm using the code shown below which displays 3 input fields - when you click on an input field, a DIV is displayed which allows you to select a task. On clicking the task, it is inserted into the...
5
by: jaysonnward | last post by:
Hello All: I've recently been recreating some 'dropdown menus' for a website I manage. I'm writing all my event handlers into my .js file. I've got the coding to work in Firefox, but the...
6
by: erdos | last post by:
I have an asp.net 2.0 button with server and client side click events. On the first click, both events will fire. On the next click, only the client side event fires. How do I make the server...
2
Mobius Evalon
by: Mobius Evalon | last post by:
I'm trying to make this thing work in Firefox, because I know the client my game is on is pondering switching to Gecko (they're currently using something very similar to IE4 for browser windows...
2
by: sorobor | last post by:
dear sir .. i am using cakephp freamwork ..By the way i m begener in php and javascript .. My probs r bellow I made a javascript calender ..there is a close button ..when i press close button...
2
by: markszlazak | last post by:
Could someone check out the following code and please help me understand the problem and fix it. It seems like some events are not firing when my mouse moves over the table cells to quickly causing...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
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,...
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,...
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...
0
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,...

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.