Krypton-Suite / Standard-Toolkit

An update to Component factory's krypton toolkit to support .NET Framework 4.6.2 - 4.8.1 to .NET 6 - 8
BSD 3-Clause "New" or "Revised" License
386 stars 57 forks source link

[Bug]: KryptonMessageBox text is not centered vertically #1613

Closed Ahmed-Abdelhameed closed 1 month ago

Ahmed-Abdelhameed commented 1 month ago

Because KMB now uses a KTextBox to display the text, the text doesn't get centered vertically when the height of the icon is larger, which doesn't look good if compared with the original MB or older versions of KMB:

image vs image

A workaround would be to calculate the size difference and use it to offset the text box but there's a simpler solution, IMO. That is, to just increase the top and bottom margin of the text area because I think it needs more margin anyway, especially after fixing #1599.

We just need to change one line in KryptonMessageBoxForm.Designer.cs:

this._panelContentArea.Margin = new System.Windows.Forms.Padding(4);

to

this._panelContentArea.Margin = new System.Windows.Forms.Padding(4, 12, 4, 12);

Before:

One line Multiple lines No icon
image image image

After:

One line Multiple lines No icon
image image image
giduac commented 1 month ago

@Wagnerp Please assign to me and @Ahmed-Abdelhameed , ty.

Wagnerp commented 1 month ago

@Wagnerp Please assign to me and @Ahmed-Abdelhameed , ty.

@Ahmed-Abdelhameed & @giduac

Now assigned to both of you

Wagnerp commented 1 month ago

Hi @Ahmed-Abdelhameed & @giduac

In V90, it's the opposite...

image

Ahmed-Abdelhameed commented 1 month ago

This is already fixed and merged into both V85 and alpha branches.