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

Backgroundworker object instead of component

Hello,

I am using a BackgroundWorker as a base class for several workers in a
windows service application. Because BackgroundWorker is derived from
Component, Visual Studio (2008) shows the message
"To add components to your class, drag them from the ToolBox....."

Is there a way to tell Visual Studio not to show this message and just
show the sourcecode whenever I doubleclick on the cs file of the class?

One thing I can think ok is making a base class not derived from
Component and create a BackgroundWorker inside this class but that
feels a bit awkward.

regards,
Marcel
Jun 27 '08 #1
2 1915
If you're really desperate you can remove the <subtype>Component</subtype>
definition from the compile settings in the project file.

Then the file will always open in the text editor.

AFAIK there is no way of doing this at the time that the wizard puts the
file in the project.

--
--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
"Marcel Overweel" <mo*******@hotmail.comwrote in message
news:48***********************@news.xs4all.nl...
Hello,

I am using a BackgroundWorker as a base class for several workers in a
windows service application. Because BackgroundWorker is derived from
Component, Visual Studio (2008) shows the message
"To add components to your class, drag them from the ToolBox....."

Is there a way to tell Visual Studio not to show this message and just
show the sourcecode whenever I doubleclick on the cs file of the class?

One thing I can think ok is making a base class not derived from
Component and create a BackgroundWorker inside this class but that
feels a bit awkward.

regards,
Marcel

Jun 27 '08 #2
Thanks Bob.

regards,
Marcel
"Bob Powell [MVP]" <bo*@spamkillerbobpowell.netschreef in bericht
news:DC**********************************@microsof t.com...
If you're really desperate you can remove the <subtype>Component</subtype>
definition from the compile settings in the project file.

Then the file will always open in the text editor.

AFAIK there is no way of doing this at the time that the wizard puts the
file in the project.

--
--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
"Marcel Overweel" <mo*******@hotmail.comwrote in message
news:48***********************@news.xs4all.nl...
>Hello,

I am using a BackgroundWorker as a base class for several workers in a
windows service application. Because BackgroundWorker is derived from
Component, Visual Studio (2008) shows the message
"To add components to your class, drag them from the ToolBox....."

Is there a way to tell Visual Studio not to show this message and just
show the sourcecode whenever I doubleclick on the cs file of the class?

One thing I can think ok is making a base class not derived from
Component and create a BackgroundWorker inside this class but that
feels a bit awkward.

regards,
Marcel


Jun 27 '08 #3

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

Similar topics

4
by: DHarry | last post by:
Can anybody tell me, whats the main difference between a BackgroundWorker and a Thread? What are the advantages/disadvanteges? When use a BackgroundWorker, when a Thread?
2
by: Simon Tamman | last post by:
Just wondering if anyone knows how this component works. If you set it up in the context of an Application.Run it works on it's worker thread but it updates the progress on the UI thread. My...
5
by: redear | last post by:
Is there a way to immediately terminate a BackgroundWorker thread? My problem is that the BackgroundWorker starts with a call to My.Computer.FileSystem.GetFiles that can run for a very long time if...
14
by: =?Utf-8?B?SXNobWFlbA==?= | last post by:
Hi, I have a form with a progress bar on it and wanted to use the BackgroundWorker to be able to update the progress. I looked at examples, run some of them, but in debug, when the code gets to...
5
by: Michael M. | last post by:
I have the following code (listed at bottom of post) that pings a small range of IP address to see which ones are alive. To speed things up a little I am trying to use more than one thread,...
2
by: Chris | last post by:
When I try to access the backgroundWorker.CancellationPending property I get the following exception: An unhandled exception of type 'System.Reflection.TargetInvocationException' occurred in...
9
by: RvGrah | last post by:
I'm completely new to using background threading, though I have downloaded and run through several samples and understood how they worked. My question is: I have an app whose primary form...
2
by: =?Utf-8?B?SGFycnkgS2Vjaw==?= | last post by:
I have introduced a component to my solution that is throwing an exception about needing to be run in single threaded apartment mode. This component is created in an async call by a...
2
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgS2lxdWVuZXQ=?= | last post by:
Hi misters, I have introduced a component to my solution that is throwing an exception about needing to be run in single threaded apartment mode. This component is created in an async call by...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.