Questions tagged [ownerdrawn]

This allows the user to custom draw controls at run time in the Win32 Api. Any existing control can have its appearance altered through the paint message. This is C, C++,C# and Delphi applicable.

When you are changing the appearance of most any Win32 controls, you specify the _OWNERDRAW flag. This will then allow you to intercept the paint messages of desired control.

184 questions
5
votes
1 answer

tabcontrol ownerdraw changes the tabcontrol's border style

I got a problem with tabcontrol. When I change the DrawMode to ownderdrawfixed, the borderstyle of the tabcontrol changes from "fixedsingle" to "3dfixed" but there's no such a property of tabcontrol borderstyle. the closest thing to borderstyle of…
Ron
  • 3,975
  • 17
  • 80
  • 130
5
votes
3 answers

Change size of ToolStripMenuItem

I'm custom drawing a menu item in a MenuStrip. The problem I'm having is that the menu item insists on sizing itself based on the text, which is not what I want (there is no text). I can set AutoSize to false and explicitly specify a size, but the…
snarf
  • 2,684
  • 1
  • 23
  • 26
5
votes
1 answer

How to remove the dotted focus rectangle from TListBox?

I am using ListBox.Style := lbOwnerDrawFixed with OnDrawItem: procedure TForm1.ListBox1DrawItem(Control: TWinControl; Index: Integer; ARect: TRect; State: TOwnerDrawState); begin with ListBox1.Canvas do begin Brush.Color := clWhite; …
Tom
  • 2,962
  • 3
  • 39
  • 69
5
votes
4 answers

Hiding focusRectangle for a StringGrid : Delphi

I'm trying to hide the border (focus rectangle) which Delphi draws around the currently selected cell in a StringGrid. I'm doing owner drawing to customize the appearance of the string grid. I've managed to get rid of everything but the…
Daisetsu
  • 4,846
  • 11
  • 50
  • 70
5
votes
3 answers

How to make an ownerdraw Trackbar in WinForms

I'm trying to make a trackbar with a custom graphic for the slider thumb. I have started out with the following code: namespace testapp { partial class MyTrackBar : System.Windows.Forms.TrackBar { public MyTrackBar() { …
Adam Pierce
  • 33,531
  • 22
  • 69
  • 89
5
votes
2 answers

Alphablend and TransparentBlt

This question is related to my earlier question on SO. I want to combine two layers with alpha applied only to a specific portion of the source layer. One way I tried was to set SourceConstantAlpha to $ff (and have the function use the alpha channel…
wmercer
  • 1,102
  • 2
  • 11
  • 24
4
votes
1 answer

Simple TListView OwnerDraw Text Font Size and Color example?

I am trying to owner draw a List View control in report-mode with 4 columns, using OnCustomDrawItem. When I try to change the Canvas.font.color, and that's all I do, I have no problems. If I set canvas.font.size, I find that there is no change in…
Warren P
  • 65,725
  • 40
  • 181
  • 316
4
votes
5 answers

Delphi 6 TListBox OnMeasureItem() and OnDrawItem() never called for lbOwnerDrawVariable() list box

I have a Delphi 6 app with a TListBox control set to lbOwnerDrawVariable. At run-time I add a single string to the list box. I have event handlers for OnMeasureItem() and OnDrawItem() and I set breakpoints on the very first line of code in each…
Robert Oschler
  • 14,153
  • 18
  • 94
  • 227
4
votes
1 answer

How to draw UI elements with Visual Styles turned off?

I have a owner drawn control where I need to draw the expand box ("plus/minus") of a treeview. With visual styles turned on it is easy, just create a renderer for the appropriate VisualStyleElement: VisualStyleElement element =…
crypto_rsa
  • 341
  • 1
  • 12
4
votes
1 answer

DrawItemEventArgs' "Index" property goes negative sometimes

I have an owner-drawn listbox control. The problem is that sometimes the DrawItemEventArgs argument passed to my DrawItem event-handler has an Index property of "-1". This is my unethical fix: private void lstBox_DrawItem(object sender,…
Saeb Amini
  • 23,054
  • 9
  • 78
  • 76
4
votes
1 answer

How to selectively invalidate Owner Drawn TListBox's canvas?

I have an owner drawn TListBox (lbVirtualOwnerDraw), whose content gets updated dynamically (there can be as high as 10 updates in a second). There can be up to 300 items in the list box at a time. Each item may have about 5 lines of text and an…
ssh
  • 943
  • 1
  • 14
  • 23
4
votes
4 answers

How to create a non OwnerDraw Button in .NET?

I'm creating a plugin to a software that skins the form I created. However, the button are not skin based on them and a standard gray button is shown. Asking on the software forum pointed me that .NET forms control are owner-draw and therefor my…
Lucian
4
votes
1 answer

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?
Anders
  • 97,548
  • 12
  • 110
  • 164
4
votes
1 answer

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…
Coincoin
  • 27,880
  • 7
  • 55
  • 76
4
votes
3 answers

C++ Win32, Can Edit Controls be Owner Drawn?

I am trying to get my dialog box to match. I have been all through google, random testing, etc, even read some places it cant be done. What I have been able to do is to use one of the messages to set font and colors, but nowhere about drawing…
Evan Carslake
  • 2,267
  • 15
  • 38
  • 56
1
2
3
12 13