﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » WinForms (How do I?)  » Multiline textbox with scrollbar problem</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Sat, 12 Sep 2026 12:14:49 GMT</lastBuildDate><ttl>20</ttl><item><title>Multiline textbox with scrollbar problem</title><link>http://forum.strataframe.net/FindPost25210.aspx</link><description>Hi,&lt;/P&gt;&lt;P&gt;For multiline textboxes with scrollbars, the scrollbars are disabled when the bound business object is in the idle editing state. This means a user has to enter edit mode to scroll through the textbox contents. This is the opposite of what happens with the richtextbox and syntaxeditor.&lt;/P&gt;&lt;P&gt;Have I missed a setting on the textbox to enable the scrollbars when in the idle editing state?&lt;/P&gt;&lt;P&gt;Aaron</description><pubDate>Tue, 17 Nov 2009 18:29:59 GMT</pubDate><dc:creator>Aaron Young</dc:creator></item><item><title>RE: Multiline textbox with scrollbar problem</title><link>http://forum.strataframe.net/FindPost25234.aspx</link><description>Great.&amp;nbsp; Thanks again.</description><pubDate>Tue, 17 Nov 2009 18:29:59 GMT</pubDate><dc:creator>Russell Scott Brown</dc:creator></item><item><title>RE: Multiline textbox with scrollbar problem</title><link>http://forum.strataframe.net/FindPost25228.aspx</link><description>Sure, here it is:&lt;/P&gt;&lt;P&gt;// In the MyRichTextBox class:&lt;/P&gt;&lt;P&gt;namespace SubClassedRichTextBoxDemo&lt;BR&gt;{&lt;BR&gt;&amp;nbsp; class MyRichTextBox : MicroFour.StrataFrame.UI.Windows.Forms.Textbox&lt;BR&gt;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public MyRichTextBox()&lt;BR&gt;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; BindingEditable = true;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Enabled = true;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Multiline = true;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ReadOnly = true;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ScrollBars = System.Windows.Forms.ScrollBars.Vertical;&lt;BR&gt;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;}&lt;BR&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR&gt;// In the form:&lt;/P&gt;&lt;P&gt;using System;&lt;/P&gt;&lt;P&gt;namespace SubClassedRichTextBoxDemo&lt;BR&gt;{&lt;BR&gt;&amp;nbsp; public partial class Form1 : MicroFour.StrataFrame.UI.Windows.Forms.StandardForm&lt;BR&gt;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public Form1()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {InitializeComponent();}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private void Form1_Load(object sender, EventArgs e)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {string[] Numbers = { "Bothell", "Portland", "Seattle", "Duluth", "Dallas" };&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (int i = 0; i &amp;lt;= 4; i++)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {myRichTextBox1.Text += Numbers[i] + System.Environment.NewLine;}}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private void button1_Click(object sender, EventArgs e)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; { myRichTextBox1.ReadOnly = false; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private void button2_Click(object sender, EventArgs e)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; { myRichTextBox1.ReadOnly = true; }&lt;BR&gt;&amp;nbsp; }&lt;BR&gt;}&lt;/P&gt;&lt;P&gt;I can also zip up the little app and upload it, if that would be better.&lt;/P&gt;&lt;P&gt;Les</description><pubDate>Tue, 17 Nov 2009 15:07:23 GMT</pubDate><dc:creator>Les Pinter</dc:creator></item><item><title>RE: Multiline textbox with scrollbar problem</title><link>http://forum.strataframe.net/FindPost25227.aspx</link><description>Hello Les, would you be able to provide a C# example of this?&lt;/P&gt;&lt;P&gt;Thanks</description><pubDate>Tue, 17 Nov 2009 14:38:48 GMT</pubDate><dc:creator>Russell Scott Brown</dc:creator></item><item><title>RE: Multiline textbox with scrollbar problem</title><link>http://forum.strataframe.net/FindPost25226.aspx</link><description>Thanks guys.</description><pubDate>Tue, 17 Nov 2009 13:53:58 GMT</pubDate><dc:creator>Aaron Young</dc:creator></item><item><title>RE: Multiline textbox with scrollbar problem</title><link>http://forum.strataframe.net/FindPost25216.aspx</link><description>Hi Aaron,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I often need to be able to scroll a list when I'm not currently editing.&amp;nbsp;I created a subclassed StrataFrame TextBox by right-clicking on the project name and selecting Add, Class (which defaults to Class1.vb), naming it MyTextBox, and then entering this for the class code:&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;Public Class MyTextBox : Inherits MicroFour.StrataFrame.UI.Windows.Forms.Textbox&lt;/P&gt;&lt;P&gt;&amp;nbsp; Sub New()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyBase.New()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; BindingEditable = True&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Enabled = True&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Multiline = True&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [ReadOnly] = True&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ScrollBars = Windows.Forms.ScrollBars.Vertical&lt;BR&gt;&amp;nbsp; End Sub&lt;/P&gt;&lt;P&gt;End Class&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;I was then able to drop one of these on my form and get it to do what I wanted like this:&lt;/P&gt;&lt;P&gt;Public Class frmCustomers&lt;/P&gt;&lt;P&gt;&amp;nbsp; Private Sub ToolStripContainer1_ContentPanel_Load( _&lt;BR&gt;&amp;nbsp;&amp;nbsp; ByVal sender As System.Object, ByVal e As System.EventArgs) _&lt;BR&gt;&amp;nbsp;&amp;nbsp; Handles ToolStripContainer1.ContentPanel.Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CustomersBO1.Fill()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim Numbers() As String = {"First", "Second", "Third", "Fourth", "Fifth"}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; For i As Integer = 0 To 4 : MyTextBox1.Text &amp;amp;= Numbers(i) &amp;amp; vbCrLf : Next&lt;/P&gt;&lt;P&gt;&amp;nbsp; End Sub&lt;/P&gt;&lt;P&gt;&amp;nbsp; Private Sub MaintenanceFormToolStrip1_ItemClicked( _&lt;BR&gt;&amp;nbsp;&amp;nbsp; ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolStripItemClickedEventArgs) _&lt;BR&gt;&amp;nbsp;&amp;nbsp; Handles MaintenanceFormToolStrip1.ItemClicked&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Select Case e.ClickedItem.Text&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case "Edit"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyTextBox1.Enabled = True&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyTextBox1.ReadOnly = False&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case "Save"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyTextBox1.Enabled = False&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyTextBox1.ReadOnly = True&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Select&lt;/P&gt;&lt;P&gt;&amp;nbsp; End Sub&lt;/P&gt;&lt;P&gt;End Class&lt;/P&gt;&lt;P&gt;This is a multiline textbox with five city names; when databound cust_City in the sample database, the only name that shows up is the one in the current CustomerBO record. Remove the databinding and all five city names appear. I'm not sure what your precise requirement is, but this may point the way.&lt;/P&gt;&lt;P&gt;Les&lt;/FONT&gt;</description><pubDate>Mon, 16 Nov 2009 10:54:41 GMT</pubDate><dc:creator>Les Pinter</dc:creator></item><item><title>RE: Multiline textbox with scrollbar problem</title><link>http://forum.strataframe.net/FindPost25214.aspx</link><description>I don't think you've missed anything.  However, it should be fairly easy to remedy. Just create your own TextBox class, and override the BindingEditable property to turn on/off the Textboxes Readonly property instead of the enable property. Since this likely is just for multiline textboxes, you could even just automatically set multiline property in the constructor too. :D</description><pubDate>Mon, 16 Nov 2009 09:44:56 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item></channel></rss>