ownerdraw

OwnerDrawn control in MFC

Hi, I am creating a MFC application in which there is a skin library which handles the UI effect of rendering the controls (it gets called in oninitdialog). But, meanwhile, I have also the requirement of displaying an icon on the buttons. For this, I am marking the buttons as ownerdrawn=true, and able to display icon, but in this case,...

CStatic Custom Control

I am trying to create a custom CStatic control in vc++ and have a few problems. I originally was just using a CStatic control with the SS_BLACKRECT style. This was good for the situation until I needed to display an image over the control on demand. I figured out all the logistics behind actually drawing the image onto the control but I ...

C# ListBox DrawItem HotLight State in the OwnerDraw mode ?

Hello, i'm using OwnerDrawFixed as a DrawMode for the custom ListBox control in my WinForms app. I want to repaint the background (or do some other action) of the ListBoxItem when the user hovers over the listbox item, that is, at the MouseMove... DrawItemState.HotLight never works for the ListBox, so i wonder how to emulate it, how to...

Transparency around non-rectangular (owner draw) ToolTip control?

I'm customizing the appearance of a WinForms ToolTip control by responding to the Draw event. I just want some of the ToolTip's corners to be rounded. I've got everything working such that the first time the ToolTip is displayed, everything looks perfect. On subsequent displays, however, the unfilled areas of my rounded rectangle continu...

How to get hot node coords of TVirtualStringTree?

Hi. I'm trying to paint VirtualStringTree's cell differently when mouse is over it. How can I detect the coords of hot node? I know there's a HotNode property but it returns only Node that is under mouse cursor. I need to get cell coords (X,Y) of that node. ...

Windows.Forms.ListBox OwnerDrawVariable measuring problem in MeasureItem

I have a baffling problem that I've been stuck on for hours and can't find a fix for. I have inherited a class from the ListBox class so that I can create multi-line and multi-coloured item content. I have the following in the MeasureItem method: SizeF headingSize = e.Graphics.MeasureString(exam.Name, HeadingFont, ClientSize.Width); Siz...

How to change height of owner drawn listbox dynamically in windows mobile?

Hi, I am trying to create owner drawn listbox on windows mobile 6.1 I have specified LBS_OWNERDRAWFIXED style while creating listbox control. I am handling WM_MEASUREITEM and WM_DRAWITEM accordingly. I want to change height of listbox item whenever its font changes (I change it using WM_SETFONT after creating control). The problem is ...

Winforms: Multiple columns in a listbox

Is there a way to configure a subclassed listbox to arrange items into multiple columns? http://i50.tinypic.com/2n9vozc.png I've considered using a listview, but it seems overkill for what i'm trying to do. Clarification: I want to put multiple items in the same row, rather than giving each item more than one column. ...

TreeView owner draw glitch when selecting

I'm trying to add a few more icons to elements of a standard System.Windows.Forms.TreeView control. My plan was to only change the label area of the treeview control, but it shows a strange behaviour. If I click a node to select it, when the mouse button is depressed the background is draw correctly with the highlight color. However, th...

How do I draw my own submenu arrow in owner draw menus (and prevent windows from painting its arrow on top of mine)

Windows seems to draw the submenu arrow after I have done my painting in WM_DRAWITEM, how can I stop windows from drawing the arrow? ...

.NET OwnerDraw ComboBox: Vista/7 themed DropDownList

I'm working on a custom ComboBox for a project, and have the basic painting working. One of the remaining things to do is make it look like the default ComboBox in Vista and 7, when the DropDownStyle is set to DropDownList (looks like a button instead of a regular ComboBox). I read much about VisualStyleRenderer, read ComboBox.cs and Co...

Why the DrawItem method of my owner draw listbox can't be called

I try to write a owner draw listbox with WTL. My code looks like this template class ATL_NO_VTABLE CMyListBoxImpl : public CWindowImpl, public COwnerDraw { ... BEGIN_MSG_MAP(CMyListBoxImpl) MESSAGE_HANDLER(WM_CREATE, OnCreate) MESSAGE_HANDLER(WM_DESTROY, OnDestroy) MESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBackground) ...

Delphi, List Index out of bounds

I have a TListBox on a form, and items are added with listbox1.ItemIndex := listbox1.Items.AddObject('msg', TObject(grp)); grp is an integer, The listbox is set to lbOwnerDrawFixed In the onDrawItem event i get the Exception EStringListError raise on the marked line msg := (control as Tlistbox).Items.Strings[index]; <-- this line ...

How to write my own CStatic derived class

that subclasses a CStatic dialog item in an MFC dialog, shows a bitmap and processes some mouse events There must be tons of samples that do that Please point to one good one. ...