Windows Develop Bookmark and Share   
 index > Windows Forms Designer > Visual inheritance, Design Error
 

Visual inheritance, Design Error

Hi,

I created a class library and a win formin it. In the win form I create an instance ofa class c_path. That class has a function thatreturns the path to the xmlfile.The xml file is in the bin of the class library.

sFileXML = CurDir() + \XML\traduction.xml

Now I create a new application and inherit the form created in the class library. But I have the following error in the design window

Could not find a part of the path 'C:\Users\user\Desktop\test10\WindowsApplication1\XML\traduction.xml'.

Well the application runs fine, but at design time I have the above mentioned error.


Sha_woop  Thursday, September 13, 2007 6:40 AM

The problem is that the designer try to load the file before showing you the form - you are calling this function in the Ctor or something like that.

Make sure you are not calling the File load method before form load or use DesignMode (don't load when in DesignMode)

if(!DesignMode)

LoadFile();

(Please note that the DesignMode works only after the constructor)

Eli Gazit  Sunday, September 16, 2007 7:28 AM

The problem is that the designer try to load the file before showing you the form - you are calling this function in the Ctor or something like that.

Make sure you are not calling the File load method before form load or use DesignMode (don't load when in DesignMode)

if(!DesignMode)

LoadFile();

(Please note that the DesignMode works only after the constructor)

Eli Gazit  Sunday, September 16, 2007 7:28 AM

You can use google to search for other answers

Custom Search

More Threads

• I want to have the first column in the ListView as a LinkLabel in Windows Forms.
• Changing size and position leaves the selection handles behind.
• Is it possible to specify access modifier in IDesignerHost.CreateComponent?
• Design time only data
• Where does Windows.Forms implement the control property editor?
• Is it possible....?
• A designer like the MenuStrip or ContextStrip Desinger?
• Can one use an image for the actual control?
• programmatically setting the treeview scroll position
• new to XML ..Write XML How ?? [:(]