oh.. it makes the apps lag only.. the system doesnt lag
good
oh.. it makes the apps lag only.. the system doesnt lag
good
Hi, I've search throughout the net, cant find any solution. Hope someone able to help me. My apps had a panel which can draw many rect. The app can be moved by draggin left/right using mouse. Whenever i moved the panel, it'll try to move all the rectangle to top/bottom/left/right following the mouse motion. When the mouse move, it will force the rectangle to be redraw. My app become laggy whenever i use .DrawText to a multiple line of text inside the rectangle. I have around 80++ rect which used .DrawText to display the text on each rect. I've tested, if the text is only 1 short words without /r/n (one line), then it will display nicely without laggy. eg: Alice But if the text is in multiline (about 4~5 lines) i tried to run .DrawText, it makes my apps lagg. eg: Alice in wonderland Any idea ?? The command i used : dc.DrawText(strDraw, rcText, DT_LEFT | DT_WORD_ELLIPSIS); Regards, KH
good
oh i'm using the pDC to draw the rectangle. That one I'm just testing out with the link given by Chandrasekharanp I'm taking pDC out now and try your method. But after i put below code, and execute it then the button went dissapear void CCustomEdit::PreSubclassWindow() { CRect rcItem; this->GetClientRect(&rcItem); CRgn rgn; rgn.CreateRoundRectRgn(rcItem.left, rcItem.top, rcItem.right, rcItem.bottom, 50, 50); SetWindowRgn( (HRGN)rgn.Detach(), TRUE ); CEdit::PreSubclassWindow(); }
good
what place should i place the CreateRoundRectRgn() and SetWindowRgn() ? I've try below code but it seems like the EditBox keep on blinking CRect rcItem; CDC* pDC=this->GetDC(); this->GetClientRect(&rcItem); CRgn rgn; rgn.CreateRoundRectRgn(rcItem.left, rcItem.top, rcItem.right, rcItem.bottom, 50, 50); SetWindowRgn( (HRGN)rgn.Detach(), TRUE ); Thanks, KarHong
good
Hi, I've tested out but the shape of the box is still square. Thanks for your reply
good
Thank you very much.. I'll get back to you later after i tried your method..
good
Hi, I've created CCustomEdit inherited from CEdit and managed to change its background color and text color. I'm trying to change the shape of it ( eg : on each end i plan to make it like curve a bit rather than 90 degrees ) Is there any ways to change the shape of the CEdit ? Any tutorials/sample would be highly appreciated. Can GDI able to change the style of it? My project is MFC based. With thanks, KarHong
good
Do i Change the WM_CTLCOLOR on my CCustomStatusBar or on the MainFrm ? KH
good
Is there any ways for me to set the seperator on the status bar become smaller?? by default, the width of it is 0.1cm Or can I disable/remove the seperator between the item in the status bar ??
good
modified on Tuesday, January 13, 2009 3:03 AM
Hi, I'm able to set the text and the background color of the text for Status bar, but I'm not able to set the color for the 'seperator' of the status bar. I have 3 column on the status bar, each of the text and background I'm able to set it but have no luck on the 'seperator' I've done it by creating a custom status bar inherited from CStatusBar By drawing it on DrawItem CODE: CDC oDC; CDC* pdc = CDC::FromHandle(pDIS->hDC); pdc->FillSolidRect(&pDIS->rcItem, RGB(255,255,255)); oDC.Attach(pDIS->hDC); oDC.SetTextColor(RGB(255,0,0)); oDC.SetBkColor(pDIS->itemData); pDIS->rcItem.left += 2; oDC.DrawText(_T("Test"),&pDIS->rcItem,DT_LEFT); oDC.Detach(); Any ways to do this? I wanted to change the whole status bar into white color RGB(255,255,255) Any help would be appreciated. KH
good
yea.. i hope to make the imgList.Draw icons to have the background color of RGB(73,73,73)
good
Hi, I'm loading resource>toolbar into CImageList When i draw using imageList.draw, then the transparent is no more work any idea? CImageList ImgList; COLORREF rgbTransparentColor = RGB(73,73,73);//dono what this use.. CBitmap bmp; int bubu = bmp.LoadBitmapW(IDR_MAINFRAME);//the toolbar to be loaded ImgList.Create(16.5,14.5,ILC_MASK | ILC_COLOR32,1,1); ImgList.Add(&bmp, rgbTransparentColor);//put the bitmap into imagelist CPoint ptImage(rectIcon.left + 1, rectIcon.top + 1);//get the point(position) of the rectangle to be drawn ImgList.Draw(pDC, nIconPosi, ptImage, ILD_NORMAL);//draw the icon
good
Has anyone of u used this article owner draw menu? If anyone used it and know how to solve my problem, Please help - Highly Appreciated http://www.codeproject.com/KB/menus/bcmenu.aspx Hi, when i tried this owner draw menu, why did the DrawItem function are not being triggered?? Because when i tried other owner draw menu, even if i did not click the menu item[on the menu bar] it will trigger the DrawItem. I'm trying to change the font's color of the menu item text[on the menu bar] I already succeeded to change the font color of the submenu items.. which it will trigger DrawItem function when i click it. Thanks, KH
good
BUMP
good
modified on Friday, January 2, 2009 4:26 AM
Hi, can anyone give me some hint on how to change the background color of the toolbar when the mouse hover/point to it? i've tried WM_EraseBkGnd Regards, KH
good
How do i get the icon/bitmap from CMenu and then draw it on void CMyMenu::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) { } Currently i able to get the check mark with ODS_CHECKED But i don't know how do i get the icon/bitmap from the original CMenu Any help would be appriciated Regards, KH
good
modified on Friday, December 19, 2008 2:10 AM
thanks ! ^^ got it worked out :-\
good
Hi Iain, Thanks for your reply. But what u showed are the example of change the font as well as its itallic/bold and draw the text based on the fonts Correct if i'm wrong towards the code you're trying to show Regards, KH
good
because i currently put some code inside ::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) CDC* pDC; //i used this to draw a rect to the menu CRect rect; rect.left=lpDrawItemStruct->rcItem.left; rect.top=lpDrawItemStruct->rcItem.top + 2; rect.right=lpDrawItemStruct->rcItem.right; rect.bottom=lpDrawItemStruct->rcItem.bottom + 2 //str is a string which i want to output : eg -> Open\tCtrl+O pDC->DrawText (str,rectt,nFormat); //this will draw text into the menu/submenu What i want now is i want to make a checkmark/icon on the left side of the Text. I'm not sure on how to draw it on the left side of the text
good
Hi, Is there any ways for me to add a check marks or icon into the submenu? I'm currently creating owner draw menu. So far, I only able to print out the text into the submenu... I failed to put the check mark/icon into it.. Any help will be appreciated Currently all my drawing are done at: DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) { } Regards, KH
good