Skip to content

Commit 8e12082

Browse files
author
ArthurHub
committed
* fix text property not working in label and panel with huge text
1 parent c553562 commit 8e12082

2 files changed

Lines changed: 16 additions & 6 deletions

File tree

‎Source/HtmlRenderer/HtmlLabel.cs‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ public class HtmlLabel : Control
8383
/// </summary>
8484
private CssData _baseCssData;
8585

86+
/// <summary>
87+
/// the current html text set in the control
88+
/// </summary>
89+
private string _text;
90+
8691
/// <summary>
8792
/// is to handle auto size of the control height only
8893
/// </summary>
@@ -270,13 +275,13 @@ public override Size MinimumSize
270275
[Description("Sets the html of this control.")]
271276
public override string Text
272277
{
273-
get { return base.Text; }
278+
get { return _text; }
274279
set
275280
{
276-
base.Text = value;
281+
_text = value;
277282
if (!IsDisposed)
278283
{
279-
_htmlContainer.SetHtml(Text, _baseCssData);
284+
_htmlContainer.SetHtml(_text, _baseCssData);
280285
PerformLayout();
281286
Invalidate();
282287
}

‎Source/HtmlRenderer/HtmlPanel.cs‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ public class HtmlPanel : ScrollableControl
7676
/// </summary>
7777
private CssData _baseCssData;
7878

79+
/// <summary>
80+
/// the current html text set in the control
81+
/// </summary>
82+
private string _text;
83+
7984
#endregion
8085

8186

@@ -216,14 +221,14 @@ public override bool AutoScroll
216221
[Description("Sets the html of this control.")]
217222
public override string Text
218223
{
219-
get { return base.Text; }
224+
get { return _text; }
220225
set
221226
{
222-
base.Text = value;
227+
_text = value;
223228
if (!IsDisposed)
224229
{
225230
VerticalScroll.Value = VerticalScroll.Minimum;
226-
_htmlContainer.SetHtml(Text, _baseCssData);
231+
_htmlContainer.SetHtml(_text, _baseCssData);
227232
PerformLayout();
228233
Invalidate();
229234
}

0 commit comments

Comments
 (0)