How to call a UserControl? RRS feed

  • Question

  • Hi,

    I have frmReports and I have inside it:

    public XtraUserControl user_control;

    Now I want to pass the user control like this:

    frmReports ReportsForm = new frmReports();
    ReportsForm.user_control= ucReportsItemwiseSales;
    ReportsForm.Dock = DockStyle.Fill;

    but getting:

    ucReportsItemwiseSales is a type but used like a variable.

    How can I fix this please?

    Tuesday, October 6, 2015 9:08 PM


  • Hi Jassim,

    >>ucReportsItemwiseSales is a type but used like a variable.

    How do you define the ucReportsItemwiseSales? It could be better to provide a simplified repro to help us understand your scenario better.

    From above message, the error is obvious. Please try to use a variable instead.

    Have a nice day!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, October 7, 2015 6:25 AM