MinLines is the minimum
number of lines that must be visible in the text box. For example, if MinLines is 2, the
text box will grow to be at least two lines tall. If its container doesn??™t have enough room, part
of the text box may be clipped. MaxLines sets the maximum number of lines that will be displayed.
Even if a text box expands to fit its container (for example, a proportionally sized Grid
row or the last element in a DockPanel), it won??™t grow beyond this limit.
nNote The MinLines and MaxLines properties have no effect on the amount of content you can place in a
text box. They simply help you size the text box. In your code, you can examine the LineCount property to
find out exactly how many lines are in a text box.
If your text box supports wrapping, the odds are good that the user can enter more text
that can be displayed at once in the visible lines. For this reason, it usually makes sense to add
an always-visible or on-demand scroll bar by setting the VerticalScrollBarVisibility property to
Visible or Auto. (You can also set the HorizontalScrollBarVisibility property to show a less
common horizontal scroll bar.)
You may want to allow the user to enter hard returns in a multiline textbox by pressing the
Enter key. (Ordinarily, pressing the Enter key in a text box triggers the default button.
Pages:
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402