• Welcome to Valhalla Legends Archive.
 

Outlining

Started by vuther.de, January 17, 2005, 03:59 PM

Previous topic - Next topic

vuther.de

Is there any possible way to outline rtb, listviews, and textboxes without using lines or textboxes?

Zakath

What do you mean by "outline?" You mean you want to mess with the border around the control?
Quote from: iago on February 02, 2005, 03:07 PM
Yes, you can't have everybody...contributing to the main source repository.  That would be stupid and create chaos.

Opensource projects...would be dumb.

vuther.de

#2
I forgot to add into that, I took away the border of them. So it is borderless, im trying to outline them with a black border instead of it's normal border.

Yegg

You could try using line controls.

Networks

Quote from: Yegg on January 17, 2005, 04:45 PM
You could try using line controls.

He doesn't want to do that. I suggested to him to use some sort of API because I know it's out there, I just didn't know which declares and functions. So if someone could provide that, that'd be just dandy ^^.

OnlyMeat

#5
Quote from: inner. on January 17, 2005, 03:59 PM
Is there any possible way to outline rtb, listviews, and textboxes without using lines or textboxes?

As far as i know ( if you are using vb ) it has a border property which allows you to set the style etc.

If that fails you could always use the win32 GDI functions
CreateRectRgn and FrameRgn.

It would probably go something like this ( note i haven't tested this code so dont take it as plugin and work, also you need to add error checking on the return values of the GDI functions as they can fail! )


// Create the rectangle region
HRGN hRgn = ::CreateRectRgn(10,10,10,10); // insert appropriate rectangular dimensions.

// Create the brush object
HBRUSH hBrush = ::CreateSolidBrush(RGB(0,0,0)); black as requested ( this will by default have a line thickness of 1 pixel.

// Now draw the rectangular border
// Assumes you have a reference to your window's/controls device context handle (hDC)
::FrameRgn(hDC,hRgn,hBrush,10,10); // insert approriate width/height arguments ( the last 2 )

// Now cleanup GDI objects
::DeleteObject(hRgn);
::DeleteObject(hBrush);


Thats in raw API format but using MFC or something can make it much more simplistic.