0

Ok so I have started to create an metro application using dotnetbar within visual studio its all working apart from 'CloseModalPanel' my problem is when I try to close the panel from the usercontrol.cs to return back to my main form I am told 'UserControl does not contain a definition for CloseModalPanel' can anyone see what I am doing wrong or what I must do to fix this? Code below:

Main.cs

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

namespace MetroStyle
{
    public partial class Main : DevComponents.DotNetBar.Metro.MetroAppForm
    {
        public Main()
        {
            InitializeComponent();
        }

        private void metroTileItem1_Click(object sender, EventArgs e)
        {
            UserControl1 _UserControl = new UserControl1();
            this.ShowModalPanel(_UserControl);
        }

        private void metroTileItem2_Click(object sender, EventArgs e)
        {

        }
    }
}

UserControl.cs

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevComponents.DotNetBar.Metro;
using DevComponents.DotNetBar;
using System.Diagnostics;
using DevComponents.AdvTree;
using DevComponents.DotNetBar.Metro.ColorTables;

namespace MetroStyle
{
    public partial class UserControl1 : UserControl
    {
        public UserControl1()
        {
            InitializeComponent();
        }

        private void buttonX1_Click(System.Object sender, System.EventArgs e)
        {
            //Main.CloseModalPanel(this, DevComponents.DotNetBar.Controls.eSlideSide.Right);

            UserControl1.CloseModalPanel(this, DevComponents.DotNetBar.Controls.eSlideSide.Right);


        }
    }
}
2
Contributors
1
Reply
7
Views
3 Years
Discussion Span
Last Post by Ketsuekiame
0

UserControls don't contain a definition for CloseModalPanel, this method is contained within the MetroAppForm class.

Also, for anyone wondering, this is DotNetPanel for WindowsForms by DevComponents. This isn't built into Visual Studio.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.