Creating an "invisible" user control

S

Scott McNair

Hi,

I'm creating a user control that has absolutely no visual pieces to it...
it's essentially a piece that sniffs a serial port awaiting incoming data.
I know that there are several controls that come natively with .NET that
don't actually reside on the form, but go to the bottom area, such as for
example database-related controls. How would I go about setting my own
control to do just that? Otherwise I'm left with the quandary of either
having the control be lost on the form (since there's no visual clues) or
having to put a graphic on it and then mark it as not visible.

Cheers,
Scott
 
R

rowe_newsgroups

Hi,

I'm creating a user control that has absolutely no visual pieces to it...
it's essentially a piece that sniffs a serial port awaiting incoming data.
I know that there are several controls that come natively with .NET that
don't actually reside on the form, but go to the bottom area, such as for
example database-related controls. How would I go about setting my own
control to do just that? Otherwise I'm left with the quandary of either
having the control be lost on the form (since there's no visual clues) or
having to put a graphic on it and then mark it as not visible.

Cheers,
Scott

I believe you need to just create a Component, they reside in the bar
at the bottom of the form designer.

Thanks,

Seth Rowe [MVP]
 
L

Lloyd Sheen

Scott McNair said:
Hi,

I'm creating a user control that has absolutely no visual pieces to it...
it's essentially a piece that sniffs a serial port awaiting incoming data.
I know that there are several controls that come natively with .NET that
don't actually reside on the form, but go to the bottom area, such as for
example database-related controls. How would I go about setting my own
control to do just that? Otherwise I'm left with the quandary of either
having the control be lost on the form (since there's no visual clues) or
having to put a graphic on it and then mark it as not visible.

Cheers,
Scott

Scott,
Since the "control" has no visible piece why is it a control? I think
you can think of a control as a class which in most cases is visible. You
can create the class for you work and then simply have it as a variable
within the form it is used in. If you are doing this to capture events you
can still capture events using AddHandler or the WithEvents keyword in the
declaration of the variable.

Hope this helps
Lloyd Sheen
 
J

Jack Jackson

Hi,

I'm creating a user control that has absolutely no visual pieces to it...
it's essentially a piece that sniffs a serial port awaiting incoming data.
I know that there are several controls that come natively with .NET that
don't actually reside on the form, but go to the bottom area, such as for
example database-related controls. How would I go about setting my own
control to do just that? Otherwise I'm left with the quandary of either
having the control be lost on the form (since there's no visual clues) or
having to put a graphic on it and then mark it as not visible.

Cheers,
Scott

A class derived from Component resides below the visual area in the
designer.

If you don't need to set properties at design time, why not just make
it be a plain class that is instantiated at runtime?
 
H

Herfried K. Wagner [MVP]

Scott McNair said:
I'm creating a user control that has absolutely no visual pieces to it...
it's essentially a piece that sniffs a serial port awaiting incoming data.
I know that there are several controls that come natively with .NET that
don't actually reside on the form, but go to the bottom area

"Project" -> "Add new item..." -> "Component" (translated from the German
version of VS 2005).

Components, which reside in the components tray of the Windows Forms editor,
are classes which are derived from 'System.ComponentModel.Component'.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top