473,909 Members | 6,009 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1605
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_NCLBUTTONDOW N/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******** ******@TK2MSFTN GP02.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
1038
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
2289
by: Adrian | last post by:
How do I put an icon on a form using code? Thank you.
1
1261
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 anything else I should be doing?
4
2071
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 want. I've been using a PictureBox, hooking its Paint event and doing it manually. Is there a better way? Thanks, Jacob
2
1396
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 the Sizable FormBorderStyle, but the icon remains. I read something about needing to overload CreateParams to disable the icon. Does anyone know how to do this?
13
3708
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 the MDI Form appears, no problem, we have not ther controlbox. But when I maximize the MDI Form, the controlBox appears and I DON'T WANT THAT !!!!!
3
1582
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
1265
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 from the window ? Is a window without Icon possible ?
1
7600
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 ControlBox gets shown between the top and the menu of the parent box, which looks really bad (at least to me). Is there a way to disable showing the controlbox or even better - show the
0
10035
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9877
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11346
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10919
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11046
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10538
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6138
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4774
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 we have to send another system
2
4336
muto222
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.