| C++ºô´õ Æ÷·³ |
|
|
|
|
|
|
|
| º¼·£µåÆ÷·³ Ȩ |
|
|
|
|
|
|
|
|
|
|
|
| ȸ¿ø ¸Þ´º |
|
|
 |
|
|
|
|
 |
|

|
|
| [779] [Controls] ¸®½ºÆ®ºä(ListView)¿¡ ¹è°æ ±×¸² ³Ö±â 2 |
[nasilso]
|
1812 ÀÐÀ½ 2008-07-15 12:59 |
¸®½ºÆ®ºä¿¡ ¹è°æ ±×¸² ³Ö±â 1źÀº
¾ÆÁÖ ¿À·¡Àü¿¡ ÀÓÇÁ´Ô²²¼ ¿Ã¸®½ÅÀû ÀÌ ÀÖ½À´Ï´Ù.(10³âÀÌ ´Ù µÇ¾î°¡³×¿ä)
1. http://cbuilder.borlandforum.com/impboard/impboard.dll?action=read&db=bcb_tip&no=39
À§ ÀÓÇÁ´Ô¿¡ ±â»ç¸¦ º¸¸é ListView¿¡ ¹è°æÀ̹ÌÁö¸¦ ³Ö´Â ¹æ¹ýÀÌ ¿ø·¡ºÎÅÍ Á¦°øµÇÁö
¾Ê´Â°Íó·³ ¸»¾¸Çϼ̴µ¥...
CommCtrl.h ÆÄÀÏ¿¡ º¸¸é
±¸Á¶Ã¼ tagLVBKIMAGE °¡ ÀÖ°í
¸Þ¼¼Áö·Î LVM_SETBKIMAGE , LVM_GETBKIMAGE µîÀÇ Á¤ÀÇ µÇ¾îÀÖ½À´Ï´Ù.
¸Þ¼¼Áö¸¦ º¸¸é ºÐ¸íÈ÷ ListView¿¡ BackImage¸¦ ¼³Á¤ÇÏ°í ¶Ç °¡Á®¿À´Â ¹æ¹ýÀÌ
¿ø·¡ºÎÅÍ Á¦°øµÈ´Ù´Â ¾ê±âÀε¥....
±×·¡¼ LVM_SETBKIMAGE ·Î ±¸±Û¸µ ÇØº¸´Ï ÁÖ·ç·è... ¶ß´õ±º¿ä
±×Áß¿¡ bcbjournalÀ̶ó´Â C++Builder ÀâÁöÀÇ 2000³â ±â»ç¿¡
Adding a background image to a listview ¶ó´Â Á¦¸ñÀ¸·Î ¾ÆÁÖ ÀÚ¼¼È÷ ¼³¸íÇØ¼ ½Ç¾î ³õ¾Ò´õ±º¿ä
http://bcbjournal.org/articles/vol4/0012/Adding_a_background_image_to_a_list.htm
¿ø¸®´Â
1. LVM_SETBKIMAGE ¸Þ¼¼Áö·Î LVBKIMAGE ±¸Á¶Ã¼¿¡´Ù°¡ ÀûÀýÈ÷ µ¥ÀÌŸ ¼³Á¤Çؼ
SendMessageÇϴµ¥...
| |
void __fastcall TForm1::Button1Click(TObject *Sender)
{
LVBKIMAGE lvbki = {0};
lvbki.ulFlags = LVBKIF_SOURCE_URL | LVBKIF_STYLE_TILE;
lvbki.pszImage = TEXT("C:\\test.bmp\0");
SendMessage( ListView1->Handle, LVM_SETBKIMAGEA, 0, (WPARAM)&lvbki );
| |
2. ListView ÀÚü¿¡¼ ÀÌ ±â´ÉÀ» COMÀ» ÀÌ¿ëÇØ¼ ±¸ÇöÇѰÍÀ̱⠶§¹®¿¡
CoInitialize ¸¦ SendMessageÇϱâ Àü¿¡ È£ÃâÇØ Áà¾ßÇϱ¸¿ä
| |
void __fastcall TForm1::FormCreate(TObject *Sender)
{
if(FAILED(CoInitialize(NULL)))
{
throw EWin32Error( "Failed to initialize the COM libraries!" );
}
}
| |
3. Áß¿äÇÑ°Í ÇѰ¡Áö´õ ListViewÀÇ WM_ERASEBKGND ¸Þ¼¼Áö¸¦ Àâ¾Æ¼
DefaultHandler·Î ¸Þ¼¼Áö¸¦ ó¸®ÇØ Áà¾ß ÇÕ´Ï´Ù.
| |
void __fastcall TForm1::FormCreate(TObject *Sender)
{
OrgProc=ListView1->WindowProc;
ListView1->WindowProc=ListVProc;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ListVProc(TMessage &Msg)
{
if( Msg.Msg==WM_ERASEBKGND)
ListView1->DefaultHandler(&Msg);
else
OrgProc(Msg);
}
//---------------------------------------------------------------------------
| |
delphifaq.com ÀÇ Delphi ¿¹Á¦
http://www.delphifaq.com/faq/delphi/windows_GUI/f670.shtml
| |
type
TMyListView = class(TListView)
protected
procedure WndProc(var Message: TMessage);
override;
end;
procedure TMyListView.WndProc(var Message: TMessage);
begin
if Message.Msg = WM_ERASEBKGND then
DefaultHandler(Message)
else
inherited WndProc(Message);
end;
procedure TForm1.LVBGImage;
var
BKimg : TLVBKIMAGE;
begin
FillChar(BKimg, SizeOf(BKimg), 0);
BKimg.ulFlags := LVBKIF_SOURCE_URL or LVBKIF_STYLE_TILE;
BKimg.pszImage := PChar('c:\windows\angler.bmp');
BKimg.xOffsetPercent := 0;
BKimg.yOffsetPercent := 0;
CoInitialize(nil);
SendMessage(ListView1.Handle, LVM_SETTEXTBKCOLOR, 0, integer(CLR_NONE));
SendMessage(ListView1.Handle, LVM_SETBKIMAGE, 0, integer(@BKimg));
CoUninitialize;
end;
| |
±×¹Û¿¡ ÀÚ¼¼ÇÑ »çÇ×Àº bcbjournalÀÇ ±â»ç¸¦ ÂüÁ¶Çϼ¼¿ä
http://bcbjournal.org/articles/vol4/0012/Adding_a_background_image_to_a_list.htm
±×·³..
|
°ü·Ã ±Û ¸®½ºÆ®
|
¿¹Àü¿¡ bcbjournal¿¡¼ ¾ðµí ºÃÀ»¶§´Â ¾µ ÀÏÀÌ ¾ø¾î ±×³É µÎ¾ú´Ù°¡ Àؾú´Âµ¥
¿À´Ã À强ȣ´ÔÀÌ ¿Å±â½Å ÆÁÀ¸·Î ½ÇÇèÇØº¸´Ï ¾ÆÁÖ ±ò²ûÇÏ°Ô Àß µé¾î°¡³×¿ä.
±×·±µ¥ TreeView ¿¡ ´ëÇÑ ¹è°æ ±×¸² ³Ö´Â °ÍÀº ¾ø³ª¿ä?
¸Þ½ÅÀú¿¡ º¸¸é ÁÖ·Î TreeView¸¦ ÀÌ¿ëÇϴµ¥ ¿©±â¿¡ ¹è°æ ±×¸² ³ÖÀ» ¼ö ÀÖ´Ù¸é
ÁÁ°Ú±º¿ä.