How to add an icon in the tab of a new document ? (dockpanel-suite)

1.4k views Asked by At

Maybe some one can help me or tell me how to add an icon in the tab of a new document in "DockPanel Suite" ? Or what is the best way to do this ? Thank you in advance for your help and feedback. Regards, Daniel

(Another point. It will be nice to do that with VS2012 Light theme. Thank you in advance. Daniel)

1

There are 1 answers

4
Lex Li On BEST ANSWER
  1. Set DockContent.Icon to the icon you want (similar to set Icon of a normal Form).

  2. Set DockPanel.ShowDocumentIcon to true.

If you look for a sample, this Compiler project uses this feature,

https://github.com/lextudio/sharpsnmplib/tree/51773488fcb7b9714a38134187363fef5762daca/Compiler

To get VS2012 theme, make sure that

  1. You use our 3.0 NuGet package or build from development_3.0 branch, https://github.com/dockpanelsuite/dockpanelsuite/tree/development_3.0

  2. Create a new instance of VS2012LightTheme class and assign it to DockPanel.Theme.

This has been demonstrated in DockSample project of DockPanel Suite,

https://github.com/dockpanelsuite/dockpanelsuite/blob/development_3.0/DockSample/MainForm.cs

You can see the changes needed in SetSchema method.

Note that all existing DockContent objects should be cleaned before changing themes.