Control with a border

H

Harry Hudini

Is there a control that has a border property whose background colour i can
change ?

I need to have a box which has a black border (1 or 2 px's) and which has a
background property.

I thought a panel would have one. I have knocked together one using two
panel controls, but before i make lots of them, i was wondering if there
might be an easier way.

--
________________________________________________
ADSSupport.net
http://www.adssupport.net
Dedicated free Active Directory ServicesT support

email: oliver.marshall@[email protected]
 
T

Tim Wilson

Rather than creating a whole bunch of these "<control>-in a panel-in a
panel" controls, you can make this into one custom control and then reuse it
throughout your application. Give it a border thickness, border style, and
border color property and then you should have much of the flexibility that
you need.
 
H

Harry Hudini

dont suppose you could point me towards a good example of how i would go
about doing this ?
 
T

Tim Wilson

(1) What are you trying to accomplish overall? Just a basic container that
has flexible border properties?
(2) What language are you using (C# or VB.Net)?
 
H

Harry Hudini

1) Yes

2) VB.net

Tim Wilson said:
(1) What are you trying to accomplish overall? Just a basic container that
has flexible border properties?
(2) What language are you using (C# or VB.Net)?

--
Tim Wilson
.Net Compact Framework MVP
{cf147fdf-893d-4a88-b258-22f68a3dbc6a}
colour
 
C

Chris Tacke, eMVP

Take a look at the OpenNETCF GroupBox. It has a BorderStyle and modifying
to code to add color should be pretty simple.
 
T

Tim Wilson

Ok, that's relatively easy to implement as it will be similar to the
OpenNETCF SDF GroupBox, as Peter mentioned in his reply earlier in this
thread.
http://www.opennetcf.org/SourceBrow...ot/Source/OpenNETCF.Windows.Forms/GroupBox.cs

The only catch here is that you *cannot* currently build design-time
controls from VB.Net source against the Compact Framework. So this could be
a catch here. If you are comfortable with C# you might consider using this
language to develop this control instead of VB.Net. If you need some help
just post back here and I'm sure I could give you a hand with this.
 
H

Harry Hudini

Great thanks for letting me know. I had a few ideas for controls (simple
ones) but as I wouldnt know C# from roast chicken, i can pretty much put
them to one side.

I appreciate that opennetcf is great source of abilities, but Im keen to do
things myself, and at over 200k its almost three times the size of my exe
and i would only be using it for one or two things.

Cheers
 
T

Tim Wilson

Ok, if you run into a snag with anything just post to this newsgroup and I'm
sure I, or someone, will give you a hand. One thing to keep in mind is that
you are free to pull anything you want out of the OpenNETCF SDF and compile
it into your source directly, if you are using C#, or compile it into a
separate assembly that you simply reference in your VB.Net app - you do not
specifically need to install the entire SDF.
 

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