473,473 Members | 2,015 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Custom Drawn Treeview

I have created a transparent custom drawn treeview in c#(using lots of native code as well) that has a bitmap for its background. As well as that, I have created a custom highlight that is a different shape than the default treeview selection highlight. I catch NM_CUSTOMDRAW and in the CDDS_PREPAINT draw stage, I draw the bitmap and return the result CDRF_NOTIFYITEMDRAW

In the CDDS_ITEMPREPAINT drawstage I set the background mode to transparent, use the graphics object I receive from the NMTVCUSTOMDRAW structure available when Custom drawing and draw the non-selected nodes text. I return CDRF_SKIPDEFAULT to stop the default treeview painting

When the user clicks on a node, I need to highlight it with a eliptical highlight that I draw onto the tree. I do this in the CDDS_ITEMPREPAINT drawstage.Everything works fine EXCEPT...when I select a treenode, the previously selected and newly selected node flash a white band across the treeview. It is the width of the treeview and the hight of the node. Then my custom drawn highlight changes to the new selection.

My question is this - in c# or the native API (I have tried catching every WM_message I can think of and handle it) is there a way to stop the background of the previous and newly selected items from repainting. I have tried handling the following

WM_SETREDRA
WM_ERASEBKGN
WM_CAPTURECHANGE
WM_TIME

and others with no success. I also tried to create a transparent solid brush for WM_CTLCOLOREDIT and return it but this crashed the application

Any suggestions would be appreciated as I have worked on this solidly for two weeks with limited success - I was able to stop one of the repaints

Steve
Nov 22 '05 #1
0 1823

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Steve | last post by:
I have created a transparent custom drawn treeview in c#(using lots of native code as well) that has a bitmap for its background. As well as that, I have created a custom highlight that is a...
1
by: Phil Price | last post by:
Hi there, I'm developing a shape recognition application for the tablet PC for a) fun b) university project. Currently I'm working on the learning stage using neural networks, and have to store...
10
by: Lex | last post by:
I am writing a C# app that has a Menu. Some of the menu items will have short cuts that do not exist in the Shortcut enum. I would like the custom shortcuts to appear on the menu but as far as I...
8
by: JJBean | last post by:
Hi All, How do I create a custom paint treeview control or an owner drawn treeview control ? Any tutorials on this anywhere? Thanks, JJBean
3
by: Ed Sutton | last post by:
I need to do a custom sort on a TreeView. I have various object types associated with the TreeNode Tag property. I want to sort objects of the same type at the top of the list, other objects at...
8
by: Tinus | last post by:
Hello all, I've create a custom control (UserControl) and have a custom Item Collection. The control is a custom calendar which is draw using the Graphics Rectangle etc. functions. It is drawn...
1
by: TT (Tom Tempelaere) | last post by:
Hi there, I made a custom drawn ComboBox. The DrawItem event handler is (explanation follows) <code> private void OnDrawItem ( object sender, System.Windows.Forms.DrawItemEventArgs e ) {
15
by: Tinus | last post by:
Hello all, I've created a custom control that draws a monthly schedule (using the Draw function in C#). Basically it draws 31 boxes and writes the day number in every box. This works...
2
by: Eamon Millman | last post by:
Greetings, I'm fairly new to the new ASP.NET 2.0 controls and I'm trying to get the TreeView control to display some non-xml/sitemap data I want to have in a tree format. To accomplish this...
0
by: apenly | last post by:
Hi all- I'm trying to Render a TreeView in a custom control, but I'm receiving a NullReferenceException at runtime. If I put the TreeView on the page it works fine, but as soon as I try to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.