Click here to Skip to main content
15,889,462 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello as you can read on my title I have an error on my project and I do not know why I get it, and I have asked on the topic where I got the resource from. Which is: http://www.codeproject.com/KB/cs/SharpFormEditorDemo.aspx?msg=3586200#History12

And my errors are:

C#
//-------------------------------------------------------
private DesignFrame FindDesignerFrame(string text)
{
    Content[] documents = dockManager.Documents;

    foreach (Content C in documents)
    {
        DesignFrame frm = C as DesignFrame; // ERROR HERE
        if (frm != null)
        {
            if (frm.FileName == text)
            {
                return frm;
            }
        }
    }
    return null;
}

//-------------------------------------------------------
private void dockManager_ActiveDocumentChanged(object sender, EventArgs e)
{
    DesignFrame df = dockManager.ActiveDocument as DesignFrame; // ERROR HERE
    if (df != null && m_PropertyWindow != null)
    {
        df.UpdatePropertyWindow();
    }
}

//-------------------------------------------------------
private Content GetContentFromPersistString(string persistString)
{
    if (persistString == typeof(PropertyWindow).ToString())
        return m_PropertyWindow; // ERROR HERE
    else if (persistString == typeof(Toolbox).ToString())
        return m_toolbox;
    else
        return null;
}


and the errors descriptions are:

Cannot convert type 'WeifenLuo.WinFormsUI.Content' to 'SharpDesignerTest.Forms.DesignFrame' via a reference conversion, boxing conversion, unboxing conversion, wrapping conversion, or null type conversion<br />
<br />
<br />
Cannot convert type 'WeifenLuo.WinFormsUI.Content' to 'SharpDesignerTest.Forms.DesignFrame' via a reference conversion, boxing conversion, unboxing conversion, wrapping conversion, or null type conversion<br />
<br />
Cannot implicitly convert type 'VBDevelop.NET.Forms.PropertyWindow' to 'WeifenLuo.WinFormsUI.Content'	


All help is appreciated thanks! :thumbsup: :D
Posted
Updated 3-Sep-10 4:29am
v3
Comments
Toli Cuturicu 3-Sep-10 10:25am    
Reason for my vote of 1
Don't ask here, even if you don't get an answer at the article forum. Please wait. The author is not forced to answer you as soon as possible.

1 solution

It's telling you exactly what you're doing wrong. Since there are probably very few people here that are using that library, you're going to have to work out the proper casting on your own.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900