473,386 Members | 1,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

New icon in ControlBox

Hello,

I Would like to add a new icon near the close/minimiez/maximize button in a
winfor
Did someone know how to do it ?

Thanks in advance
Franck

Jul 28 '08 #1
1 1578
There's no built-in functionality for doing this. You need to override the
WM_NCPAINT message, allow the non-client area to paint, and then paint your
button on top of it. You'll also need to handle WM_NCLBUTTONDOWN/UP, etc.
Basically, it's like a special-case custom control. I've never done this
from .NET, so yo may be able to do this from OnNcPaint and OnNcLButtonDown,
etc...

But it's not like adding a button to a form at all. Also, your button won't
pick up theme settings, so your button may look completely wrong. One way of
dealing with it is to somehow create a screenshot of one of the existing
buttons (minimize, close, maximize) and then use that to determine how to
draw the button similar to the theme.

"Franck FJ. Jobard" <Fr***********@PIERREMAUCHAMP.COMwrote in message
news:OL**************@TK2MSFTNGP02.phx.gbl...
Hello,

I Would like to add a new icon near the close/minimiez/maximize button in
a winfor
Did someone know how to do it ?

Thanks in advance
Franck

Jul 28 '08 #2

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

Similar topics

0
by: Microsoft | last post by:
How to make a sizable form with a title and a close button, but no icon and not ControlBox=false ??? Thank
8
by: Adrian | last post by:
How do I put an icon on a form using code? Thank you.
1
by: Rookie | last post by:
Hi, In the title bar of the form, there is an icon displayed. How do I get rid of it? I tried programmatically doing : this.Icon=null; (this refers to the form) That didn't work. Is there...
4
by: Jacob | last post by:
What's the best way to put an Icon in the client area of a form (not in the ControlBox)? Everything I've tried seems to produce unsatisfactory results. A picture box doesn't give me the icon size I...
2
by: Tim | last post by:
Hi, I am trying to create a form with the following attributes: 1. A sizable border 2. Min, Max, and Close buttons 3. No icon in the upper left hand corner All of this can be accomplished using...
13
by: Sylo | last post by:
Hi, I'm french and I don't find the answer at my question. You are my last chance and sorry for my english... I'm in VB .NET 2002 I have a MDI form with the property ControlBox at FALSE. When...
3
by: krishna | last post by:
Hi, I would like to disable the close icon on the form which will be available at the right most corner of the form in VB.NET which property i have to set. Regards, Krishna.
2
by: Peter Stojkovic | last post by:
I have programmed a window with an icon. Now I want, that this window has NO Icon. But I can not remove the icon within VS.NET. I can only select an other ICON ! How can I remove the icon...
1
by: Saso Zagoranski | last post by:
Hi, In .NET 2.0 I have a MDI (parent) form with a menu and a toolbar. I also have a MDI child form displayed in the mdi parent form. The problem is, that when I maximize the child form it's...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.