3

I want to know how to add additional button to Form ControlBox that is present at image below: 1

I know in this forum are few similar questions but no single one answered my question. I checked few links and its not that what i expected because its not working at every operating system. I checked those links:

Other idea is to change default click event and icon for MaximizeBox because i don't need this one in my app.

4
  • It is not a form control box, but a window (form) caption (title) buttons. I'd like to know answer on this question myself. Commented Dec 12, 2013 at 12:35
  • They call property as ControlBox and anyone can set it as invisible (all three buttons disappear) that's why i call it this name. Commented Dec 12, 2013 at 12:51
  • Messing with the window chrome was feasible 20 years ago. It is over and done with, you'll never get it right on every Windows version. Commented Dec 12, 2013 at 15:01
  • @HansPassant I know it can be difficult or kinda easy but there must be any possibility to do this like at screen above. I have seen many applications which have 4 or more buttons like this. Commented Dec 12, 2013 at 15:40

1 Answer 1

1

Scratch this - just realized it's a Winforms issue.

Kinda lame suggestion, but in WPF I'd do: enter image description here

Drop the title

<Window> ... WindowStyle="None"  ... /<Window>

Then roll my own:

<StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Right">
    <Button HorizontalAlignment="Right" Width="25" Content="Yo!"/>
    <Button HorizontalAlignment="Right" Width="20" Content="-"/>
    <Button HorizontalAlignment="Right" Width="20" Content="■"/>
    <Button HorizontalAlignment="Right" Width="20" Content="X"/>
</StackPanel>

Caveats:

You will have to do a mouse capture to move the window, not difficult but not trivial either. Also change the style of the buttons to look like the regular icons etc

Not ideal I know, but in a pinch ...

Sign up to request clarification or add additional context in comments.

1 Comment

I know about it my friend. I know its possible, I can even made my own form extend native form, set border less and draw own border, add manually events. That solution isn't easy but will work. There is only one problem it will never looks like default, what isn't expected. There must be other way to do this many applications got it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.