Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm Controls / September 2006

Tip: Looking for answers? Try searching our database.

plus/minus button in a TreeView.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Peter Larsen [] - 15 Sep 2006 12:51 GMT
Hi,

Is it possible to change the bitmap used to show the plus-/minus-sign button
in a TreeView ??

BR
Peter
Kevin Spencer - 15 Sep 2006 14:17 GMT
You can set the ShowPlusMinus property to false, and then override the
OnPaint method in a derived class.

Signature

HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Surgery

What You Seek Is What You Get.

> Hi,
>
[quoted text clipped - 3 lines]
> BR
> Peter
Peter Larsen [] - 15 Sep 2006 14:45 GMT
Thanks, but i don't want to do any ownerdraw.
The thing is that the corners of the icon is white, and i want it to be
darker or transparent.

/Peter
Jeff Gaines - 15 Sep 2006 16:01 GMT
On 15/09/2006 in message <#cHcS2M2GHA.1548@TK2MSFTNGP02.phx.gbl> Peter
Larsen [] wrote:

>Thanks, but i don't want to do any ownerdraw.
>The thing is that the corners of the icon is white, and i want it to be
>darker or transparent.
>
>/Peter

Pity we don't get the source to the .NET classes, I'm sure we used to with
older versions of VS.

Signature

Jeff Gaines

Kevin Spencer - 15 Sep 2006 17:50 GMT
Hmmm. I want to go to New York, but I don't want to leave my home. Sometimes
what you need to do and what you want to do in order to achieve what you
need to to are 2 completely contradictory things. I guess you'll just have
to decide which of the 2 things is the thing that you want more than the
other.

Signature

HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Surgery

What You Seek Is What You Get.

> Thanks, but i don't want to do any ownerdraw.
> The thing is that the corners of the icon is white, and i want it to be
> darker or transparent.
>
> /Peter
Peter Larsen [] - 18 Sep 2006 10:10 GMT
Please Kevin - I want to change the transparent color or the background
color because thats what i need.
I don't want to ownerdraw the entire control just to change one icon.
The problem is the icon and it should be fixed there - not by creating new
problems.

BR
Peter

> Hmmm. I want to go to New York, but I don't want to leave my home.
> Sometimes what you need to do and what you want to do in order to achieve
[quoted text clipped - 7 lines]
>>
>> /Peter
Linda Liu [MSFT] - 18 Sep 2006 11:47 GMT
Hi Peter,

Do you mean that you want to set the plus/minus icon to a transparent
color?

You could disable the XP visual styles to your application in order to
display a transparent plus/minus icon.

To do this, C#comment out the line of code
'Application.EnableVisualStyles();' in the Program.cs file if you're using
. If you're using VB.Net, right-click the project in the Solution Explorer
and choose Properties. In Project Designer, select the Application tab.
Clear the checkbox before the 'Enable XP visual styles' option.

If this is not what you need, please feel free to let me know.

Sincerely,
Linda Liu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
Peter Larsen [] - 19 Sep 2006 11:41 GMT
Hi Linda,

What i mean is that it seems like all XP controls are designed to be placed
on white backgrounds.
Try place a ProgressBar on a dark/black background and you will see 4 white
dots in each corner - it doesn't look nice.

BR
Peter
Linda Liu [MSFT] - 20 Sep 2006 05:30 GMT
Hi Peter,

Yes, this appearance is a feature of XP visual styles. If you don't like
it, you may disable the XP visual styles in your program.

You could do this by following the steps I mentioned in my previous reply.

If you have any concerns, please feel free to let me know.

Sincerely,
Linda Liu
Microsoft Online Community Support
Peter Larsen [] - 25 Sep 2006 08:14 GMT
Hi Linda,

This is not the kind of answer i had hoped for, but i got the message: If i
want XP standard controls placed on darker backgrounds, i have to use
ownerdraw.

BR
Peter
Kevin Spencer - 18 Sep 2006 12:15 GMT
Hi Peter,

You don't have to draw the whole Control, just the plus signs. When you
override the OnPaint method, first, call the base class's OnPaint method to
draw the Control, then add to it.

Signature

HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Surgery

What You Seek Is What You Get.

> Please Kevin - I want to change the transparent color or the background
> color because thats what i need.
[quoted text clipped - 16 lines]
>>>
>>> /Peter
Dmitry Kolchev - 16 Sep 2006 14:51 GMT
Hi!
You need set DrawMode property of the TreeView control to OwnerDrawAll and
handle DrawNode event

Dmitry Kolchev

> Hi,
>
[quoted text clipped - 3 lines]
> BR
> Peter
Peter Larsen [] - 18 Sep 2006 10:14 GMT
Btw, the problem seems to exist for all controls with rounded corners.

BR
Peter

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.