Mick
Mon Dec 10 08:30:46 PST 2007
Hi Ankit,
If you're going to be using Windows XP or Vista then you may have a simple
solution as described by Hans Passant in the following thread:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2044742&SiteID=1
Other than that you'll probably have to use some sort of hack like the
following:
\\\
private void Form1_ResizeBegin(object sender, EventArgs e)
{
if (this.tabControl1.SelectedTab == this.tabPage1)
{
this.treeView1.Dock = DockStyle.None;
this.treeView1.Anchor = AnchorStyles.Left | AnchorStyles.Top |
AnchorStyles.Right | AnchorStyles.Bottom;
this.Controls.Add(this.treeView1);
this.treeView1.Location =
this.tabControl1.PointToScreen(Point.Empty);
Rectangle rc = this.tabControl1.DisplayRectangle;
rc.Width -= this.tabControl1.Margin.Horizontal;
rc.Height -= this.tabControl1.Margin.Vertical;
rc.Offset(this.tabControl1.Location);
rc.Offset(this.tabControl1.Margin.Left,
this.tabControl1.Margin.Top);
this.treeView1.SetBounds(rc.Left,rc.Top,rc.Width,rc.Height);
this.treeView1.BringToFront();
}
}
private void Form1_ResizeEnd(object sender, EventArgs e)
{
if (!this.tabPage1.Controls.Contains(this.treeView1))
{
this.tabPage1.Controls.Add(this.treeView1);
this.treeView1.Dock = DockStyle.Fill;
}
}
///
--
Mick Doherty
http://www.dotnetrix.co.uk/nothing.html
<aagarwal8@gmail.com> wrote in message
news:e350667f-8e83-43ba-ad91-3c0b5e26c117@s8g2000prg.googlegroups.com...
> Hi Mick,
>
> I downloaded the control but the flickering issue still persists.
>
> The contents of the TreeView flicker a lot when i resize the form (on
> which i have docked the TabControl)
>
> Any suggestions?
>
> Regards,
> Ankit!!