Background color in NUIDocuments


Author
Message
Tomas Vera
Tomas Vera
Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)
Group: Forum Members
Posts: 6, Visits: 1
Hello All (newbie),
I want child controls added to my Document manager to have a transparent background.

My main form has a background image that I want to show through when I add child controls using the DocumentManager.

On a windows form I can simply state "BackgroundColor = Color.Transparent".

What's the equivalent operation to documents added to my document manager?

Thanks in advance,
-tomas

Reply
Tomas Vera
Tomas Vera
Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)
Group: Forum Members
Posts: 6, Visits: 1
My application has a DocumentManager that displays document in SingleDocument mode.
(DockManager.DocumentStyle.DocumentViewStyle = SingleDocument).

I want all my child NUIDocuments to display a background image. But I want to set the image on my main form, so I only have to set it once, and all the child documents allow the background image to show through.

I can set the background image programmatically using this code:
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
nDockManager1.RootContainer.Parent = nuiPanel3; // where I want my docs displayed
nDockManager1.RootContainer.BackgroundImage = Resource1.globe_bkgd; // my background image in a Resource file
nDockManager1.RootContainer.BackgroundImageLayout = ImageLayout.Stretch;
nDockManager1.RootContainer.BackColor = Color.Transparent; // needed to show the background image. not sure why.
}

I can successfully see my image if my document style is set to "MdiTabbed".

But if I set my image to "SingleDocument" or "MdiStandard" I can only see the background color (and Color.Transparent does not work; it needs to be Color.Red, Color.Green or any other non-transparent color).


I am adding documents with this code:
NUIDocument doc = new NUIDocument("My Control Title", -1, new UserControl2());
nDockManager1.DocumentManager.AddDocument(doc);

it adds the controls properly. And if DocumentStyle=MdiTabbed everything works well. But I need to use MdiSingle for display purposes.

Any suggestions?

-tomas


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search