How to display richtextbox scrollbars on a tabpage? 
Author Message
 How to display richtextbox scrollbars on a tabpage?

I have a form with a tabcontrol that has a tabpage with a listbox and
richtextbox.  I can not get the richtextbox to display its scrollbars.
See code below:

// Create the TabControl Items
// Add a TabPage Control
TabPage tabPage1 = new TabPage ();
tabPage1.Text = sgrp.SubGroupName;
tabPage1.Tag = sgrp;

// Add a Listbox Control to the TabPage
ListBox lstbox1 = new ListBox();
lstbox1.Height = 426;
lstbox1.Width = 175;
lstbox1.SelectedIndexChanged += new
System.EventHandler(lstbox1_indexChanged);
lstbox1.Font = new Font (Font, FontStyle.Italic);
lstbox1.ForeColor = System.Drawing .Color .Navy;

// Add a RichTextBox Control
RichTextBox rtb = new RichTextBox ();
rtb.Location = new Point (180,0);
rtb.Height = 418;
rtb.Width = 700;
rtb.ScrollBars = RichTextBoxScrollBars.Both;

// Add controls to tabPage1
tabPage1.Controls.AddRange(new Control[]{
                                                                                        lstbox1,
                                                                                        rtb
                                                                                                                        });
// Add controls to noteTabControl
noteTabControl.Controls.Add(tabPage1);

I do get the scrollbars for the listbox; but, not the richtextbox.  It
must have something to do with the tabpage since I have worked with
the richtextboxs before.

What am I doing wrong?

Don



Sun, 05 Jun 2005 19:44:34 GMT  
 How to display richtextbox scrollbars on a tabpage?
Don,

    I have placed the rich text box on a tab page and the scroll bars only
come out when there is more text in the richtextbox than there is display
space (which is the normal behavior).  This text box was on a tab page and
the ScrollBars property was set to Both.

    Can you post a project that shows the error?

--
               - Nicholas Paldino [.NET/C# MVP]


Quote:
> I have a form with a tabcontrol that has a tabpage with a listbox and
> richtextbox.  I can not get the richtextbox to display its scrollbars.
> See code below:

> // Create the TabControl Items
> // Add a TabPage Control
> TabPage tabPage1 = new TabPage ();
> tabPage1.Text = sgrp.SubGroupName;
> tabPage1.Tag = sgrp;

> // Add a Listbox Control to the TabPage
> ListBox lstbox1 = new ListBox();
> lstbox1.Height = 426;
> lstbox1.Width = 175;
> lstbox1.SelectedIndexChanged += new
> System.EventHandler(lstbox1_indexChanged);
> lstbox1.Font = new Font (Font, FontStyle.Italic);
> lstbox1.ForeColor = System.Drawing .Color .Navy;

> // Add a RichTextBox Control
> RichTextBox rtb = new RichTextBox ();
> rtb.Location = new Point (180,0);
> rtb.Height = 418;
> rtb.Width = 700;
> rtb.ScrollBars = RichTextBoxScrollBars.Both;

> // Add controls to tabPage1
> tabPage1.Controls.AddRange(new Control[]{
> lstbox1,
> rtb
> });
> // Add controls to noteTabControl
> noteTabControl.Controls.Add(tabPage1);

> I do get the scrollbars for the listbox; but, not the richtextbox.  It
> must have something to do with the tabpage since I have worked with
> the richtextboxs before.

> What am I doing wrong?

> Don



Sun, 05 Jun 2005 23:39:09 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. HOWTO display URL in RichTextBox

2. IWebBrowser2, How to display scrollbars?

3. CRichEditCtrl won't display scrollbars!

4. CTreeCtrl in splitter - displaying scrollbars

5. CTreeCtrl in splitter - displaying scrollbars

6. TabPage question

7. Newbit: help with TabPage and Controls

8. Adding objects to a tabpage programmitically

9. TabControl tabpage change

10. Catching the TabPage change event?

11. Broken Show() and Hide() for Forms.Form.TabPage

12. dynamically adding separately created tabpage to tabcontrol

 

 
Powered by phpBB® Forum Software