473,387 Members | 1,669 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,387 software developers and data experts.

Add custom button on title bar

Hi all,
I need to add a custom button to title bar on a form in addition of a
standard button. (Minimize/Maximize, close etc.)
I need also to handle OnClick event of this button. I looked around
google but i'm not able to find any example that can help me.

Many thanks in advance for your help.

Marco

May 2 '07 #1
7 9049
Marcolino wrote:
I need to add a custom button to title bar on a form in addition of a
standard button. (Minimize/Maximize, close etc.)
Why?

Unless you're doing something very, /very/ specialised, what does this
gain you or, more importantly, your users that you /can't/ achieve in a
more "standard" Windows way?
I looked around google but i'm not able to find any example that can
help me.
Which ought to suggest that, perhaps, it's not a very good thing to do...

Regards,
Phill W.
May 2 '07 #2
On 2 Mag, 18:12, "Phill W." <p-.-a-.-w-a-r...@-o-p-e-n-.-a-c-.-u-k>
wrote:
Marcolino wrote:
I need to add a custom button to title bar on a form in addition of a
standard button. (Minimize/Maximize, close etc.)

Why?

Unless you're doing something very, /very/ specialised, what does this
gain you or, more importantly, your users that you /can't/ achieve in a
more "standard" Windows way?
I looked around google but i'm not able to find any example that can
help me.

Which ought to suggest that, perhaps, it's not a very good thing to do...

Regards,
Phill W.
Hi Phil,
I have my reason to do this. In deep I need to change the behavior of
Maximize/Restore Button on a form.
To make this I subclassed System message to a form and now i'm able to
run my custom code. But after this, the Maximize button will not
change to minimize.
I tried with SetWindowLong and then SetWindowPos, but this change the
button but also maximize the form and I do not need this.
So I think to disable standard Maximize/restore button and to add a
new customized one, so I'll be able to make whatever I want.
I hope this is clear for you and the reason for may need.
Many thanks for your attention.

--Marco

May 2 '07 #3
http://www.codeproject.com/vb/net/tr...tlebuttons.asp

"Marcolino" <ma************@gmail.comwrote in message
news:11**********************@n76g2000hsh.googlegr oups.com...
Hi all,
I need to add a custom button to title bar on a form in addition of a
standard button. (Minimize/Maximize, close etc.)
I need also to handle OnClick event of this button. I looked around
google but i'm not able to find any example that can help me.

Many thanks in advance for your help.

Marco

May 3 '07 #4
Marcolino wrote:
On 2 Mag, 18:12, "Phill W." <p-.-a-.-w-a-r...@-o-p-e-n-.-a-c-.-u-k>
wrote:
>Marcolino wrote:
>>I need to add a custom button to title bar on a form in addition of a
standard button. (Minimize/Maximize, close etc.)
Why?

Unless you're doing something very, /very/ specialised, what does this
gain you or, more importantly, your users that you /can't/ achieve in a
more "standard" Windows way?
>>I looked around google but i'm not able to find any example that can
help me.
Which ought to suggest that, perhaps, it's not a very good thing to do...

Regards,
Phill W.

Hi Phil,
I have my reason to do this. In deep I need to change the behavior of
Maximize/Restore Button on a form.
Again, I ask .. why?

*Every* other Windows application that shows these buttons (you /can/
just hide them, BTW) behaves in exactly the same way. They have done
for years and (hopefully) will continue to do so for years to come.
Users are /familiar/ with this and "expect" [all] their applications to
work this way.

If you change this behaviour, especially if you are tinkering with an
area of the window that is normally /outside/ of an application's
control and should be the same for /every/ window shown to the user,
then you're going to confuse and alienate your user community.
the Maximize button will not change to minimize.
And I should hope not!
If I click a Maximise button on any window, I expect that window to
maximise itself. Your application is going to do something different?
Expect to be flooded with "bug reports" from your users.

Take a step back for your current problem and tell us what it is that
you want to /achieve/ (not how). Why do you want to change the
behaviour of these buttons? We might be able to give you a more
"standard" (i.e. more familiar, user-friendly, etc.) alternative.

Regards,
Phill W.
May 3 '07 #5


"Phill W." <p-.-a-.-w-a-r-d-@-o-p-e-n-.-a-c-.-u-kwrote in message
news:f1**********@south.jnrs.ja.net...
Marcolino wrote:
>On 2 Mag, 18:12, "Phill W." <p-.-a-.-w-a-r...@-o-p-e-n-.-a-c-.-u-k>
wrote:
>>Marcolino wrote:
I need to add a custom button to title bar on a form in addition of a
standard button. (Minimize/Maximize, close etc.)
Why?

Unless you're doing something very, /very/ specialised, what does this
gain you or, more importantly, your users that you /can't/ achieve in a
more "standard" Windows way?

I looked around google but i'm not able to find any example that can
help me.
Which ought to suggest that, perhaps, it's not a very good thing to
do...

Regards,
Phill W.

Hi Phil,
I have my reason to do this. In deep I need to change the behavior of
Maximize/Restore Button on a form.

Again, I ask .. why?

*Every* other Windows application that shows these buttons (you /can/ just
hide them, BTW) behaves in exactly the same way. They have done for years
and (hopefully) will continue to do so for years to come. Users are
/familiar/ with this and "expect" [all] their applications to work this
way.
Not really Phill. I have used several windows applications that contain
custom titlebar buttons. Hmm, I believe most of these apps were installed
via video card bundled software and they allow you to do many things with
the "window" that has nothing to do with the application. Of course, this
was a modification to ALL applications installed, and not just it's own
application. The button I am remember for 1 case was actually a context
menu when you clicked on it and allowed you to change the resolution of the
window, size, colors, etc. Pretty nifty for the advanced use...

Mythran
May 3 '07 #6
On May 3, 11:46 am, "Mythran" <kip_pot...@hotmail.comwrote:
"Phill W." <p-.-a-.-w-a-r...@-o-p-e-n-.-a-c-.-u-kwrote in message

news:f1**********@south.jnrs.ja.net...
Marcolino wrote:
On 2 Mag, 18:12, "Phill W." <p-.-a-.-w-a-r...@-o-p-e-n-.-a-c-.-u-k>
wrote:
Marcolino wrote:
I need to add a custom button to title bar on a form in addition of a
standard button. (Minimize/Maximize, close etc.)
Why?
>Unless you're doing something very, /very/ specialised, what does this
gain you or, more importantly, your users that you /can't/ achieve in a
more "standard" Windows way?
>>I looked around google but i'm not able to find any example that can
help me.
Which ought to suggest that, perhaps, it's not a very good thing to
do...
>Regards,
Phill W.
Hi Phil,
I have my reason to do this. In deep I need to change the behavior of
Maximize/Restore Button on a form.
Again, I ask .. why?
*Every* other Windows application that shows these buttons (you /can/ just
hide them, BTW) behaves in exactly the same way. They have done for years
and (hopefully) will continue to do so for years to come. Users are
/familiar/ with this and "expect" [all] their applications to work this
way.

Not really Phill. I have used several windows applications that contain
custom titlebar buttons. Hmm, I believe most of these apps were installed
via video card bundled software and they allow you to do many things with
the "window" that has nothing to do with the application. Of course, this
was a modification to ALL applications installed, and not just it's own
application. The button I am remember for 1 case was actually a context
menu when you clicked on it and allowed you to change the resolution of the
window, size, colors, etc. Pretty nifty for the advanced use...

Mythran
I believe Phill was talking about changing the behavior of the
"default" buttons (minimize, restore, maximize, close) and not about
additional custom buttons (like NVidia's nview titlebar buttons).

Thanks,

Seth Rowe

May 3 '07 #7
On 3 Mag, 18:57, rowe_newsgroups <rowe_em...@yahoo.comwrote:
On May 3, 11:46 am, "Mythran" <kip_pot...@hotmail.comwrote:


"Phill W." <p-.-a-.-w-a-r...@-o-p-e-n-.-a-c-.-u-kwrote in message
news:f1**********@south.jnrs.ja.net...
Marcolino wrote:
>On 2 Mag, 18:12, "Phill W." <p-.-a-.-w-a-r...@-o-p-e-n-.-a-c-.-u-k>
>wrote:
>>Marcolino wrote:
>>>I need to add a custom button to title bar on a form in addition of a
>>>standard button. (Minimize/Maximize, close etc.)
>>Why?
>>Unless you're doing something very, /very/ specialised, what does this
>>gain you or, more importantly, your users that you /can't/ achieve in a
>>more "standard" Windows way?
>>>I looked around google but i'm not able to find any example that can
>>>help me.
>>Which ought to suggest that, perhaps, it's not a very good thing to
>>do...
>>Regards,
>> Phill W.
>Hi Phil,
>I have my reason to do this. In deep I need to change the behavior of
>Maximize/Restore Button on a form.
Again, I ask .. why?
*Every* other Windows application that shows these buttons (you /can/ just
hide them, BTW) behaves in exactly the same way. They have done for years
and (hopefully) will continue to do so for years to come. Users are
/familiar/ with this and "expect" [all] their applications to work this
way.
Not really Phill. I have used several windows applications that contain
custom titlebar buttons. Hmm, I believe most of these apps were installed
via video card bundled software and they allow you to do many things with
the "window" that has nothing to do with the application. Of course, this
was a modification to ALL applications installed, and not just it's own
application. The button I am remember for 1 case was actually a context
menu when you clicked on it and allowed you to change the resolution of the
window, size, colors, etc. Pretty nifty for the advanced use...
Mythran

I believe Phill was talking about changing the behavior of the
"default" buttons (minimize, restore, maximize, close) and not about
additional custom buttons (like NVidia's nview titlebar buttons).

Thanks,

Seth Rowe- Nascondi testo tra virgolette -

- Mostra testo tra virgolette -
Hi All,
Phil I'm Italian and I'm not write English very well, but in any way I
will try to explain you and all other guys my needs.

So, the truth is that the maximize button on my app will operate as
Microsoft want, maximizing the form but in a little bit different way.
I'm trying to explaing..............
I have an MDI container with a toolbar docked on the top. Inside this
MDI I have my child form. With standard behavior, when I'll click on
maximize, the child form will be maximized but the Title Bar of my
child form will go between the title bar of MDI and the ToolBar Docked
on the top of MDI. This is horrible to see for me and final users. In
addition all other child form that will open, will be maximized, also
if for default the maximize button is disable on their properties.
I don't need this. So I modified a little bit the behavior of maximixe
button, to adapt my child form, to MDI maximum usable space. With this
operation, my child will seems maximized, but its title bar remain on
its top and all other child that will be open mantain their original
ratio and position.
The user of this app, agree with me from this point of view.
The only thing that miss to my "Little Bit Modified Maximize" is to
change the Maximize Button to Restore Button after maximized to return
the child form to its original size. From here was born my request on
this Newsgroup.

I hope that it's clear.

In any way many thanks for your helps.

Bye Marco

May 3 '07 #8

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

Similar topics

3
by: Lo?c Mah? | last post by:
Hello I try to use a Validator for a TxtCtrl placed in a Panel with a Button in order to trigger the Validator and test the content of TxtCtrl. I have looked into wxPython documentation and...
2
by: Dennis C. Drumm | last post by:
This is a restatement of an earlier post that evidently wasn't clear. I am building a custom MessageBox dialog that has, among other things, a few new button options (yes to all, no to all, etc.)...
2
by: Benny Raymond | last post by:
How would you go about custom drawing the title bar of a form? I'd like to change it so that I can add different colors to my title and also change how the close button works (since I override it...
2
by: Jay Walker | last post by:
I created a custom DataGridColumn based on Marcie Robillard's MSDN Article: Creating Custom Columns for the ASP.NET Datagrid...
2
by: Furer Ramon | last post by:
hi every one please i need know how to create a custom title bar like writing on title bar and change the look of maximize button and close button and so on using ..net framework Greets R....
1
by: mpaine | last post by:
I have read http://msdn2.microsoft.com/en-us/library/ms178472(VS.80).aspx and my interpretation is that custom events should be fired between Page_Load and Page_LoadComplete. When I run the...
1
by: Veerle | last post by:
Hi, I use the infragistics tabcontrol on several pages of my application, that looks like this: <igtab:UltraWebTab ID="MyTabPage" runat="server"> <Tabs> <igtab:Tab Key="Tab1" Text="Title for...
5
by: newlearner | last post by:
Hi, Can an custom attribute be added into a input tag, apart from the predefined one <td ><button type="button" title="title" onclick="myFunction()" name="Name" ><span>OK</span></button></td>...
4
by: =?Utf-8?B?UmljaEI=?= | last post by:
I am trying to create a project using the ASP.NET AJAX accordion control. I would like to dynamically add panes to the control with a form template added when the pane is added. I have tried...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.