Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: KryptonMessageBox does not obey tab characters like MessageBox #1424

Closed
cuppm opened this issue Apr 25, 2024 · 17 comments
Closed

[Bug]: KryptonMessageBox does not obey tab characters like MessageBox #1424

cuppm opened this issue Apr 25, 2024 · 17 comments
Labels
area:toolkit All issues related to the toolkit components. bug Something isn't working completed This issue has been completed.

Comments

@cuppm
Copy link

cuppm commented Apr 25, 2024

I'm switching usages of MessageBox to KryptonMessageBox and I noticed that the Krypton version does not display tabs in the message the same way that the WinForms version does.

To Reproduce

string strMessage = "First line\r\nSecond line\r\n\r\nFourth line\r\nLeft\tTabbed by 1\r\nLeft\t\tTabbed by 2";
MessageBox.Show(strMessage);
KryptonMessageBox.Show(strMessage);

Expected behavior
The text to be tabbed over from the left margin like the WinForms MessageBox does.

Screenshots
WinForms
image

Krypton
image

Desktop (please complete the following information):

  • OS: Windows 10
  • Version: 19045.4291
  • Framework/.NET Version: Framework 4.8
  • Toolkit Version: v4.0.30319
@cuppm cuppm added the bug Something isn't working label Apr 25, 2024
@PWagner1 PWagner1 added the area:toolkit All issues related to the toolkit components. label Apr 25, 2024
@PWagner1 PWagner1 changed the title [Bug]: KryptonMessageBox does not obey tab characters like MessageBox [Bug]: KryptonMessageBox does not obey tab characters like MessageBox Apr 25, 2024
@Smurf-IV
Copy link
Member

@Wagnerp Should this be fixed in 8.5 as well ?

@Smurf-IV
Copy link
Member

@cuppm You state that the toolkit version is v4.0.30319
This GitHub version does not support that.
Can you please use a recent version (i.e. V80.xx.x..)

@Smurf-IV Smurf-IV added need more info Needs more information to better understand the issue. awaiting feedback A fix for this issue has been implemented, waiting for feedback on the fix. labels Apr 27, 2024
@PWagner1
Copy link
Contributor

@Wagnerp Should this be fixed in 8.5 as well ?

@Smurf-IV Yes it should, as the bug is present in older versions. I remember submitting a bug report about a similar issue a few months ago...

@Smurf-IV Smurf-IV self-assigned this Apr 27, 2024
@Smurf-IV
Copy link
Member

@Wagnerp Should this be fixed in 8.5 as well ?

@Smurf-IV Yes it should, as the bug is present in older versions. I remember submitting a bug report about a similar issue a few months ago...

Can you find it and link please?

And I've just checked and it is still broken in the Current Alpha:
image

@PWagner1
Copy link
Contributor

@Wagnerp Should this be fixed in 8.5 as well ?

@Smurf-IV Yes it should, as the bug is present in older versions. I remember submitting a bug report about a similar issue a few months ago...

Can you find it and link please?

And I've just checked and it is still broken in the Current Alpha: image

Will do, once/if I can find it

@Smurf-IV
Copy link
Member

@Wagnerp Q: Why are the Font and the Text colour hard coded ? They should use the themes colours ??
Or is this just in 8.5 ?

image

@PWagner1
Copy link
Contributor

@Wagnerp Q: Why are the Font and the Text colour hard coded ? They should use the themes colours ?? Or is this just in 8.5 ?

image

@Smurf-IV I think it's a left over from a older version.

@Smurf-IV
Copy link
Member

Smurf-IV commented Apr 27, 2024

FYI:
KWrapLabel is based on the winform Label; Which cannot do tabs :-(
https://stackoverflow.com/questions/2154623/winforms-label-text-property-not-displaying-t-tab-character

Therefore

  • Cannot change the base of the KWrapLabel or KryptonLinkWrapLabel, as that will change the way the existing usages work.
  • Option 1: if a \t is found in the text then add spaces (Or the alt character(s))
  • Option 2: Change to use a Text box without edit or border to ensure text formatting
  • Option 3: Find out what Winforms does in its MessageBox and do the same.

Currently researching 3.

@PWagner1
Copy link
Contributor

FYI: KWrapLabel is based on the winform Label; Which cannot do tabs :-( https://stackoverflow.com/questions/2154623/winforms-label-text-property-not-displaying-t-tab-character

Extend the Label?

@Smurf-IV
Copy link
Member

Option 3:

Winforms just redirects to the underlying Win32 MessageBox in the User32 system dll !!

@PWagner1
Copy link
Contributor

Option 2: Change to use a Text box without edit or border to ensure text formatting

Could use KryptonRichTextBox, as that offers far more flexibility, i.e. inline hyperlinks etc.

@PWagner1
Copy link
Contributor

Is there a way to capture tabs, and replace them with alt-255?

What I ended up doing was using alt code alt-255 5 times.

@Smurf-IV
Copy link
Member

Is there a way to capture tabs, and replace them with alt-255?

What I ended up doing was using alt code alt-255 5 times.

Yes: that's option 1...

@Smurf-IV
Copy link
Member

Option 2 gives this:
image

I'll now investigate using an RichTextBox

@Smurf-IV
Copy link
Member

RichTextBox makes a mess of the LinkLabel usages, So I will not change that.
As LinkLabels are going to be removed from the V90 messageBox to restore it back to stand usage - Yes ?

@PWagner1
Copy link
Contributor

RichTextBox makes a mess of the LinkLabel usages, So I will not change that. As LinkLabels are going to be removed from the V90 messageBox to restore it back to stand usage - Yes ?

Yes, as they can be used in the newer expandable version.

Smurf-IV added a commit that referenced this issue Apr 27, 2024
…s like `MessageBox`

  - The optional `ContentAlignment` for a `KryptonMessageBox.Show` cammand is no longer possible.

#1424
Smurf-IV added a commit that referenced this issue Apr 27, 2024
…like `MessageBox`

  - The optional `ContentAlignment` for a `KryptonMessageBox.Show` command is no longer possible.

#1424
Smurf-IV added a commit to Krypton-Suite/Standard-Toolkit-Demos that referenced this issue Apr 27, 2024
…like MessageBox

  -  The optional ContentAlignment for a KryptonMessageBox.Show command is no longer possible.

#Krypton-Suite/Standard-Toolkit#1424
@Smurf-IV Smurf-IV removed their assignment Apr 27, 2024
@Smurf-IV Smurf-IV removed the need more info Needs more information to better understand the issue. label Apr 27, 2024
@Smurf-IV Smurf-IV added completed This issue has been completed. and removed awaiting feedback A fix for this issue has been implemented, waiting for feedback on the fix. labels Apr 27, 2024
@Smurf-IV Smurf-IV modified the milestones: Version 85, Version 90 Apr 27, 2024
@cuppm
Copy link
Author

cuppm commented May 2, 2024

@cuppm You state that the toolkit version is v4.0.30319 This GitHub version does not support that. Can you please use a recent version (i.e. V80.xx.x..)

Sorry, I copied the .NET runtime version string instead of the Krypton toolkit version. As you've already deduced it affected the current release of 80.24.3.64.

Thanks for fixing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:toolkit All issues related to the toolkit components. bug Something isn't working completed This issue has been completed.
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

3 participants