Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Custom Combo Error
Message
From
05/07/2008 17:13:26
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01329113
Message ID:
01329148
Views:
12
When dragging a custom control from the ToolBox to the design surface, VS will sometimes add the reference to the project when it shouldn't and you end up with duplicated references and VS gets all confused. Since this was all in the same project it could be that's what happened (it shouldn't have added any reference at all, since it was the same project, but maybe it did and got confused).

Whether that was the problem or not, I guess it doesn't matter because you found a workaround ... but keep it in mind FYI.

~~Bonnie


>I'm not sure what I did either. To solve it, I compiled the combo base class into it's own DLL. I then added to the toolbox in my combotree project, and all is well. It was all in the same project before.
>
>
>>>I create a combo class as follows. When I drop it onto a user control and compile I get the error
>>>"The type name '_ComboBase' does not exist in the type 'ComboTree.ComboTree'".

>>
>>Not sure where "ComboTree.ComboTree" comes from ... is the second ComboTree the name of your user control that you're dropping this on? did the _ComboBase class compile ok? Maybe that's where your error actually is ... did you need to add a reference to another project? So many possible reasons for this error to appear ...
>>
>>~~Bonnie
>>
>>
>>
>>>
>>>
>>>
>>>
>>>namespace ComboTree
>>>{
>>>    public class _ComboBase : ComboBox
>>>    {
>>>        // Event to handle when the down arrow is clicked
>>>        public event EventHandler ArrowClicked;
>>>
>>>        //
>>>        protected virtual void OnArrowClicked(EventArgs e)
>>>        {
>>>            if (this.ArrowClicked != null)
>>>            {
>>>                this.ArrowClicked(this, e);
>>>            }
>>>        }
>>>
>>>        // Overwrite the WndProc event to
>>>        protected override void WndProc(ref System.Windows.Forms.Message m)
>>>        {
>>>
>>>            if (m.Msg == 0x201 || m.Msg == 0x203)  //WM_LBUTTONDOWN or WM_LBUTTONDBLCLK
>>>            {
>>>                // Raise the event
>>>                this.OnArrowClicked(new EventArgs());
>>>
>>>                // Pevent the list from opening
>>>                return;
>>>
>>>            }
>>>            base.WndProc(ref m);
>>>        }
>>>    }
>>>}
>>>
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Reply
Map
View

Click here to load this message in the networking platform