[SOLVED]ComponentTool Designer bug



in VBNET (I don’t verify about C#),

add a ComponentTool for example into a Panel, it don’t create the last code for events and method/properties

try it:

  1. create a Panel
  2. create a ComponentTool

the ComponentTool has not methods/properties and events, and is not visibile with intellisense .

if you rename it with designer, the component name still remain ComponentTool1

Other bug:

if I disable the form with me.enable=false or the panel the ComponentTool still remain enabled




  • You must to post comments
Best Answer

Hi Cristian,

That’s how ComponentTools are: lightweight components, they have no events and don’t generate class members, just method members. As they are local members of InitializeComponent method, InteliSense can’t show them out of InitializeComponent method context.

Ordinary controls have the possibility not to generate members, class members. Please have a look at the attached sample, where Button1 GenerateMember is set to false.

Concerning events, the Panel control raises a ToolClick event and the ToolClickEventArgs will tell you what ComponentTool was clicked.

If e.Tool.Name = “openWindow” Then …

On ordinary controls, you have the .NET name (the InteliSense name) and a Name property. They usually match but they don’t have to match. On ComponentTool they don’t match but this is of no importance, since the component only exists inside InitializeComponent method, and the .NET name also only exists inside InitializeComponent method. The Name property is the way to tell what ComponentTool was clicked, as explained above.

Wisej is highly optimized to use as little resources as possible and ComponentTool is a very good example of saving resource consumption.

I attach a VB sample.

  • You must to post comments

Hi Tiago,

thank you for sample, very well


  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.