What to do for opening a Pop-Up in windows

4 posts, 0 answers
  1. Gaurav
    Gaurav avatar
    38 posts
    Member since:
    Apr 2007

    Posted 12 Jun 2007 Link to this post

    Hi,
    I am trying to create a user control (Windows).
    I have a requirement to open a Pop-up from that control, can you please suggest which control i can use for the same.
    I am using RadWindow in web applications.

    Thanks
    Gaurav
  2. Jack
    Admin
    Jack avatar
    2333 posts

    Posted 12 Jun 2007 Link to this post

    Hello Gaurav,

    The RadWindow control is an ASP.NET control and it cannot be used in Windows forms applications. If you are looking for a RadWindow counterpart in our Winforms suite, then you have a couple of options, depending on your exact requirements:

    • If you want something like a pop-up menu, you can use RadDropDownMenu or RadPopupControl
    • If you want to show a window, use our ShapedForm or Form 
    • If you want some kind of docking functionality, you should use RadDock for WinForms.
    I hope this helps.

    Kind regards,
    Jack
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Steve Attwell
    Steve Attwell avatar
    1 posts
    Member since:
    Nov 2007

    Posted 25 Mar 2008 Link to this post

    Hi Jack,
    Going forward with your suggestion for using RadPopupControl :
    Do you have any working examples on it?
    As i was trying to look into website and coudn't find any.
    Thanks you help.
  4. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 26 Mar 2008 Link to this post

    Hi Gaurav,

    Thank you for writing.

    Here is an example of using RadPopupControl - feel free to use it as a reference:
     
        public partial class Form1 : ShapedForm  
        {  
            MyPopup radPopupControl1;  
     
            public Form1()  
            {  
                InitializeComponent();  
                  
                radPopupControl1 = new MyPopup();  
            }  
     
            private void radButton1_Click(object sender, EventArgs e)  
            {  
                if (radPopupControl1.IsVisible)  
                {  
                    radPopupControl1.Hide();  
                }  
                else 
                {  
                    Point point = PointToScreen(this.radButton1.Location);  
                    point = new Point(point.X, point.Y + this.radButton1.Height);  
                    SetUpPopup(point);  
                    radPopupControl1.Show();  
                }  
     
            }  
     
            private void SetUpPopup(Point location)  
            {  
                this.radPopupControl1.Size = new Size(100, 100);  
                this.radPopupControl1.BackColor = SystemColors.AppWorkspace;  
                this.radPopupControl1.Location = location;  
                this.radPopupControl1.PopupText = "Hello world";  
            }  
     
        }  
     
        public class MyPopup : RadPopupControl  
        {  
            LightVisualElement element;  
     
            public MyPopup()  
            {  
                this.UseNewLayoutSystem = true;  
            }  
     
            public string PopupText  
            {  
                get   
                {   
                    EnsureChildItems();  
                    return this.element.Text;  
                }  
                set   
                {  
                    EnsureChildItems();  
                    this.element.Text = value;  
                }  
            }  
     
            protected override void CreateChildItems(RadElement parent)  
            {  
                this.element = new LightVisualElement();  
                this.element.DrawFill = true;  
                this.element.DrawBorder = true;  
                this.element.BackColor = Color.Red;  
                this.element.ForeColor = Color.Yellow;  
                this.element.GradientStyle = GradientStyles.Solid;  
                parent.Children.Add(this.element);  
            }  
        }  

    I hope this was helpful. If you have additional questions, do not hesitate to contact me again.
     

    Greetings,
    Martin Vasilev
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top