[MonoDevelop] Adding own component to toolbox

Błażej Pietrzyk blazej.pietrzyk at gmail.com
Tue Sep 4 21:13:47 UTC 2012


Hello!

Thanks for the answer. It works like a charm... but... I added my 
UniversalComboBox and in MainWindow.cs there is a line:

this.universalcomboboxgtksharp1 = global::Gtk.ComboBox.NewText ();

It says it's an error: 
"MonoDevelop/Projects/MonoTest/MonoTest/gtk-gui/MainWindow.cs(49,49): 
Error CS0266: Cannot implicitly convert type `Gtk.ComboBox' to 
`BrajanStuffGTKSharp.GTKSharpHelpers.UniversalComboBoxGTKSharp'. An 
explicit conversion exists (are you missing a cast?) (CS0266) (MonoTest)";


When I try typing this by hand (MS VS2010 normally does something like 
this automatically without using any static functions) 
"this.universalcomboboxgtksharp1 =  new 
BrajanStuffGTKSharp.GTKSharpHelpers.UniversalComboBoxGTKSharp()";

It almost works but MonoDevelop seems to overwrite this file with 
autogenerated one from Designer and asks over and over, which copy to 
use... simple thing... big problem...

How can I solve this?


W dniu 04.09.2012 16:02, Ian Norton pisze:
> I believe you add a System.ComponentModel.ToolboxItemAttribute to your 
> class like so:
>
> using System.ComponentModel;
>
>
> [ToolboxItem]
> public class  UniversalComboBoxGTKSharp : Gtk.ComboBox {
> }
>
> On 04/09/12 14:43, blazi23 wrote:
>> Hello everyone!
>>
>> I start to learn MonoDevelop and I will try to use it with 
>> NHibernate, but my first problem is I can't add my own toolbox item 
>> to the list. I would like to use it in UI Designer instead of 
>> manually typing it in *.cs.
>>
>> I have class:
>>
>> public class UniversalComboBoxGTKSharp : Gtk.ComboBox
>>
>> How can I do this?
>>
>> PS. This class is in seperate *.dll. I was tring to add this using 
>> "Add toolbox item". I point on my dll file and there is error 
>> message: "The file ... does not contain any components"...
>> _______________________________________________
>> Monodevelop-list mailing list
>> Monodevelop-list at lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/monodevelop-list
>
> _______________________________________________
> Monodevelop-list mailing list
> Monodevelop-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/monodevelop-list



More information about the Monodevelop-list mailing list