TaskDialog Checkbox messing up text formatting

TaskDialog Checkbox messing up text formatting

danail.momchilov
Contributor Contributor
666 Views
2 Replies
Message 1 of 3

TaskDialog Checkbox messing up text formatting

danail.momchilov
Contributor
Contributor

Hi, all

 

I have a TaskDialog, displaying some warnings in the model. The problems is that once I introduce a checkbox at the botttom, the text formatting appears messed up. Here is the window prior to introducing the checkbox:

 

danailmomchilov_0-1680706399038.png

 

And here's the same window displayed after the checkbox is enabled:

 

danailmomchilov_1-1680706475056.png

 

This is how the checkbox appears when there is less information, still messed up but somewhat readable:

danailmomchilov_2-1680706580146.png

 

Here's the code snippet:

 

TaskDialog errorReport = new TaskDialog("Warnings");
errorReport.MainInstruction = errors;
errorReport.ExtraCheckBoxText = "Експортване ма грешките в текстови файsл на десктопа";
errorReport.Show();
if (errorReport.WasExtraCheckBoxChecked())
{
string path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "warnings.txt");
File.WriteAllText(path, errors);
}
return Result.Failed;

 

I am using the checkbox for the export of a .txt file with all the warnings. I could easily use another approach, I was just curious if it's possible to use a checkbox and not mess up the formatting

 

667 Views
2 Replies
Replies (2)
Message 2 of 3

RPTHOMAS108
Mentor
Mentor

Never used a TaskDialog that way (interesting it has scroll bars?) would assume it wasn't designed for that much content and you should instead create your own log results window.

 

Seems the content is taking on the same width as the checkbox? In WPF they have a shared grids feature that this reminds me of but I don't know that TaskDialogue is using that layout system.

Message 3 of 3

danail.momchilov
Contributor
Contributor

Yeap, it seems like it's just taking the checkbox width. But the latter is also not determined in accordance with the checkbox text, I tried introducing a long text without new line and it was still broken in two for some reason. It's weird.. I didn't know about the scroll bar as well 😄 

 

Anyway, I might need to create a log window using WPF anyway, but I was just curious. Even with less content though, the formatting is still messed up, so I was also curious as to what determines the overall width of the TaskDialog. By the way the scroll bar also disappears once you enable a checkbox

0 Likes