Hiding toolbox items - current best way in code?
Posted: Sun Jul 19, 2009 4:42 pm
6th July Build.
I need to be able to remove some of the toolbox items, until such time as I'm able to support their use. Specifically, I need to hide the chart and cross-tab comonent families.
I've tried creating an export from the config utility, but this seems to be ignored - here's the code I'm using to load it.
I'm calling SetDesignerConfiguration from the initial entry point in my application, prior to loading my mainform, prior to creating a report, prior to loading a report, but the items I turned off still appear. I'm sure the resource is correct - I add a textReader into my GetResourceStream method to check that I could see the xml.
If I cannot do it via a config file, can I do it in code? I tried
With no success.
I need to be able to remove some of the toolbox items, until such time as I'm able to support their use. Specifically, I need to hide the chart and cross-tab comonent families.
I've tried creating an export from the config utility, but this seems to be ignored - here's the code I'm using to load it.
Code: Select all
private void SetDesignerConfiguration() {
StiConfig.Load(DesignerConfig);
}
internal System.IO.Stream DesignerConfig {
get {return GetResourceStream("Toucan.Reporter.Report.config");}
}
internal System.IO.Stream GetResourceStream(string AResourceName) {
System.Reflection.Assembly assem = this.GetType().Assembly;
System.IO.Stream result = assem.GetManifestResourceStream(AResourceName);
return result;
}
If I cannot do it via a config file, can I do it in code? I tried
Code: Select all
StiChart ch = new StiChart();
ch.PlaceOnToolbox = false;
ch.ServiceEnabled = false;