Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

ERROR:  There are no Components in <PATH> that can be placed on the toolbox.

Posted on 2005-04-04
12
Medium Priority
?
2,199 Views
Last Modified: 2011-10-03
I am getting an error when I try to add a user control to the toolbox...

ERROR:  There are no Components in <PATH> that can be placed on the toolbox.


Why is this occurring????

Here is my user control code.....

Ive created a user control (a form)  that simply needs to use the keypreview functionality of the form.  I have a third party application that is incapable of doing this so I created my own user control.   When the form fires the keypress....I'll fire events off.

Here is the code of my user control...

using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;

namespace MCControls
{

      /// <summary>
      /// Summary description for MCForm.
      /// </summary>
      ///
      public class MCForm : System.Windows.Forms.Form  //**********IF I SWITCH THIS TO Forms.TextBox it...I CAN ADD IT TO THE TOOLBOX.
      {
            private System.ComponentModel.Container components = null;

            public event EventHandler ScanUserId;
            public event EventHandler ScanLotId;

            protected virtual void OnScanUserId()
            {
                  if (ScanUserId != null)
                  {
                        ScanUserId(this, new System.EventArgs());
                  }
            }

            protected virtual void OnScanLotId()
            {
                  if (ScanLotId != null)
                  {
                        ScanLotId(this, new System.EventArgs());
                  }
            }


            public MCForm()
            {
                  // This call is required by the Windows.Forms Form Designer.
                  InitializeComponent();

                  // TODO: Add any initialization after the InitComponent call

            }

            protected override void OnKeyPress(System.Windows.Forms.KeyPressEventArgs e)
            {

                  if (e.KeyChar == 126)
                  {
                        OnScanUserId();
                  }

                  if (e.KeyChar == 38)
                  {
                        OnScanLotId();
                  }
                  
            }

            protected override void Dispose( bool disposing )
            {
                  if( disposing )
                  {
                  if( components != null )
                  components.Dispose();
                  }
                  base.Dispose( disposing );
            }

            #region Component Designer generated code
                        
                                private void InitializeComponent()
            {

                  this.Name = "MCForm";
                  this.Size = new System.Drawing.Size(712, 240);

            }
            #endregion

      }
}



Why do I get this error?????  Ive created a User Control Textbox in the same manner without any problems.  


Knoxxx
0
Comment
Question by:JohnnyKnoxville
12 Comments
 
LVL 12

Expert Comment

by:farsight
ID: 13703003
It seems to me that the intent of the toolbox is to hold controls.  That is to say, to hold things that can be put on forms.  Forms can't be put on forms, can they?  So the GUI is disallowing it.

In general:  You're trying to use something in a context that is not designed for it.

That's my guess.

If you want to use a form, and build other forms from it, you can right-click the project in the Solution Explorer, click "Add ..." and then click "Add Inherited Form ...", then select the form you want to inherit from.  (I have no experience with inherited forms, but I've heard there are "issues" with them.  Check for yourself if there are any issues significant to you.)

0
 
LVL 9

Expert Comment

by:sun4sunday
ID: 13704372
http://www.codeproject.com/aspnet/ctrlreuse.asp

Check this...this may solve your problem..

sun4sunday
0
 
LVL 8

Expert Comment

by:rajaloysious
ID: 13705409
Controls only can be added to the toolbox.

If you intend to have a specialized form for addition into your projects, then the following MAY help.
This is a template and so it should go into the templates directory.
So that when you say new then along with the form, MCForm  also appears in the menu.
I guess the templates dir should be somewhere in the installed dir
There are chances that this feature doesnt work.
It was there in VB6 and i guess also in VC6.

cheers
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 96

Expert Comment

by:Bob Learned
ID: 13707485
Yes, you need to design either a UserControl or a Component to place it in the Toolbox.

Bob
0
 

Author Comment

by:JohnnyKnoxville
ID: 13708473
Im pretty limited on flexibility with my third party application.  It has its own set of controls.   If I create a UserControl, I cannot pass data to it, only fire events.  Im trying to capture keystrokes on this third party application.  I need to capture them at the form level.  So...I planned on using the 'KeyPreview'.   From this third party app....the event will fire, but I cannot get the actual keychar value.  (because no parameters are passed....Its really stupid).  So...I planned on simply replacing their main form with my own.  Can I create a UserControl with a form on it? Im not too experienced with user controls so please bare with me.  


Thanks,


knoxxx
0
 
LVL 12

Expert Comment

by:farsight
ID: 13710126
About this third-party application ... Do you just have the executable, and no code?  Or are you slightly modifying the code of the third-party application, but are limited in the amount of changes you are willing to make?  If not the later, how do you plan to "simply replacing their main form with my own"?
0
 

Author Comment

by:JohnnyKnoxville
ID: 13721468
I am able to modify the project via the form designer only.  Not able to modify any code.  I wont even be able to create a form with keypress logic in it and 'add an existing form'.   Im very limited in what I can do.   It really sucks.


knoxxx
0
 
LVL 12

Expert Comment

by:farsight
ID: 13722043
Let's get down to root cause.

What exactly are you attempting to do?  Not how, not the mechanism, but the ultimate purpose.
What exactly is this third-party application?  (Not "What's it do", but...  What language?  Do you have source code?  Can you compile it? How can you possibly modify it in the form-designer, but not the code? )
In your initial post, you provided code, but recently you stated "Not able to modify any code".  What are you doing?

> I am able to modify the project via the form designer only.  Not able to modify any code.
You can modify it, but not modify it ???

I still don't have a clear picture of the context of this problem.

---

P.S. There are ways to hook keystroke events for the whole system using API calls.  I don't know if that would apply to your problem, though.
http://binaryworld.net/Main/CodeDetail.aspx?CodeId=3836
0
 
LVL 12

Expert Comment

by:farsight
ID: 13722063
0
 

Author Comment

by:JohnnyKnoxville
ID: 13730711
I am using FACTORYworks3.  It is a wafer tracking system that lets you monitor and log wafers as they are passed through a fab.  This product has an application called the CDE (client development environment).  It runs in VS.NET.   However when the CDE is loaded in VS.NET, most of the normal functionality of .NET is unusable.   For example, if you double-click on a form, normally you would be able to see the underlying code.   When using the CDE, double-clicking a form pops open an action designer which allows me to assign pre-defined actions and events.  When the project is saved, all of the forms are uploaded to an SQL database in XML format.  If I attempt to add an existing form to the project, it only allows me to add FACTORYworks forms....therefore I cannot create a true .NET form and add KeyEvent logic to it and add it to the project.  

What I am trying to accomplish:

The users of the system will be required to scan their badge (User ID) and scan a Lot ID(an assortment of wafers).  These barcodes contain specific characters that I am trying to capture.  For instance.....the first character of the User ID is a Tilde (~).   If I can capture this at the form level, I could automatically populate the User ID textfield.   If it begins with an Ampersand (&), I know that it is a Lot ID and can populate that textfield.   I still have access to the properties window and can set the keypreview of the form to true, but I cant add logic to check which key was entered.

So.......Im beginning to think this might not work.   Im not opposed to creating a separate app that does the monitoring and then firing an event to the CDE to let it know which textbox to set the focus to.     I am unable to pass parameters to the CDE, I can only fire events.   If my monitor app recognizes the barcode entry as ~JohnsonR, I should be able to fire a evtUserIdScanned event and set the focus to that textfield.  

Whatdya think?  Sorry if this doesnt make much sense.....its about the best I can explain how this app works.  

Here's a snippet of the form in xml format once its in the database...

<E:Envelope xmlns:E="http://schemas.xmlsoap.org/soap/envelope/" xmlns:A="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://www.w3.org/2001/XMLSchema-instance" xmlns:y="http://www.w3.org/2001/XMLSchema" E:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
  <E:Body>
    <m:CREExportObject xmlns:m="http://Brooks.ThinClient.CDEUtil">
      <FwUIDisplayItemInterchange s:type="FwUIDisplayItemInterchange">
        <displayItemId s:type="y:string">oc_frmMain</displayItemId>
        <displayItemType s:type="y:string">System.Windows.Forms.Form</displayItemType>
        <instanceOf s:type="y:string"></instanceOf>
        <isUIComponent s:type="y:boolean">false</isUIComponent>
        <revision s:type="y:string">0</revision>
        <revState s:type="y:string">Unfrozen</revState>
        <attributes s:type="FwBusDictionary">
          <entry s:type="FwAssociation">
            <key s:type="y:string">AssemblyFullName</key>
            <value s:type="y:string">System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
          </entry>
          <entry s:type="FwAssociation">
            <key s:type="y:string">AutoScale</key>
            <value s:type="y:string">False</value>
          </entry>
          <entry s:type="FwAssociation">
            <key s:type="y:string">ClientSize</key>
            <value s:type="y:string">&lt;UIList&gt;988,559&lt;/UIList&gt;</value>
          </entry>
          <entry s:type="FwAssociation">
            <key s:type="y:string">FontBold</key>
            <value s:type="y:string">False</value>
          </entry>
          <entry s:type="FwAssociation">
            <key s:type="y:string">FontFamily</key>
            <value s:type="y:string">Tahoma</value>
          </entry>
          <entry s:type="FwAssociation">
            <key s:type="y:string">FontItalic</key>
            <value s:type="y:string">False</value>
          </entry>
          <entry s:type="FwAssociation">
            <key s:type="y:string">FontSize</key>
            <value s:type="y:string">9.75</value>
          </entry>
          <entry s:type="FwAssociation">
            <key s:type="y:string">FontStrikeout</key>
            <value s:type="y:string">False</value>
          </entry>
          <entry s:type="FwAssociation">
            <key s:type="y:string">FontUnderline</key>
            <value s:type="y:string">False</value>
          </entry>
          <entry s:type="FwAssociation">
            <key s:type="y:string">FormBorderStyle</key>
            <value s:type="y:string">FixedDialog</value>
          </entry>
          <entry s:type="FwAssociation">
            <key s:type="y:string">HideUnauthorizedItems</key>
            <value s:type="y:string">True</value>
          </entry>
          <entry s:type="FwAssociation">
            <key s:type="y:string">Icon</key>
            <value s:type="y:string">oc_frmMain.Icon</value>
          </entry>
          <entry s:type="FwAssociation">
            <key s:type="y:string">Left</key>
            <value s:type="y:string">13</value>
          </entry>
          <entry s:type="FwAssociation">
            <key s:type="y:string">MaximizeBox</key>
            <value s:type="y:string">False</value>
          </entry>
          <entry s:type="FwAssociation">
            <key s:type="y:string">Menu</key>
            <value s:type="y:string">oc_frmMain.mainMenu1</value>
          </entry>
          <entry s:type="FwAssociation">
            <key s:type="y:string">StartPosition</key>
            <value s:type="y:string">Manual</value>
          </entry>
          <entry s:type="FwAssociation">
            <key s:type="y:string">SysId</key>
            <value s:type="y:string">00005a16.0a0a3c0a.41ffe2ca.000019ca.9501</value>
          </entry>
          <entry s:type="FwAssociation">
            <key s:type="y:string">TabIndex</key>
            <value s:type="y:string">0</value>
          </entry>
          <entry s:type="FwAssociation">
            <key s:type="y:string">Text</key>
            <value s:type="y:string">FACTORYworks</value>
          </entry>
          <entry s:type="FwAssociation">
            <key s:type="y:string">Top</key>
            <value s:type="y:string">13</value>
          </entry>
          <entry s:type="FwAssociation">
            <key s:type="y:string">Version</key>
            <value s:type="y:string">24</value>
          </entry>
        </attributes>

Not sure if that'll help......thanks everyone for the help on this.


knoxxx
0
 
LVL 12

Accepted Solution

by:
farsight earned 500 total points
ID: 13731319
Now it makes sense.  It sounds to me that they're just using VS.NET as a GUI environment for form-building.  It lets you add fields and lay them out.  The form is represented only as XML.  Their program reads that XML description from the database, and interprets it in their own way.  So the code all already prewritten in their application.

Unfortunately, it looks like it's definately an integration problem specific to FactoryWorks3.  I can't help.  I think Brooks support might be your best bet.

I certainly see that scanning IDs into fields is useful.  If there isn't a way they can support it in their current product, I'd certainly suggest it as an enhancement for the next version.
0
 

Author Comment

by:JohnnyKnoxville
ID: 13786647
I agree and have suggested it.  I just wish they allowed more flexibility with their product.  They market it as 'fully customizable' but that really doesnt see to be the case.



Thanks everyone!


0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

569 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question