Skip to content

Commit

Permalink
Merge pull request #1847 from giduac/1842-V85-Setting-KryptonTextBox-…
Browse files Browse the repository at this point in the history
…Multiline-to-true-shrinks-the-control

1842-V85-Setting-KryptonTextBox-Multiline-to-true-shrinks-the-control
  • Loading branch information
Smurf-IV authored Nov 15, 2024
2 parents 343d1b3 + 05cdc50 commit 86ce779
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Documents/Help/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

=======

# 2025-02-01 - Build 2502 (Patch 5) - Fefruary 2025
* Resolved [#1842](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1842), `KryptonTextBox` height collapses when MultiLine is enabled.

=======

# 2024-11-14 - Build 2411 (Patch 4) - November 2024
* Resolved [#1837](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1837), `KryptonMessageBoxDefaultButton.Button2` doesn't work
* Resolved [#1820](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1820), When KryptonDataGridView.AutoGenerate is set WinForms columns are used. See the issue for full text.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1854,7 +1854,16 @@ private void AdjustHeight(bool ignoreAnchored)
if (!ignoreAnchored || ((Anchor & (AnchorStyles.Bottom | AnchorStyles.Top)) != (AnchorStyles.Bottom | AnchorStyles.Top)))
{
// If auto sizing the control and not in multiline mode then override the height
Height = _autoSize && !Multiline ? PreferredHeight : _cachedHeight;
// #1842 when autosize == true and MultiLine == true and the _cachedHeight == -1 which is the initial value
// the box collapses. Only when _cachedHeight > -1 it will be assigned. Otherwise Height is left alone.
if (_autoSize && !Multiline)
{
Height = PreferredHeight;
}
else if (_cachedHeight > -1)
{
Height = _cachedHeight;
}
}
}

Expand Down

0 comments on commit 86ce779

Please sign in to comment.