This is a migrated thread and some comments may be shown as answers.

What to do for opening a Pop-Up in windows

3 Answers 120 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Gaurav
Top achievements
Rank 1
Gaurav asked on 12 Jun 2007, 09:25 AM
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

3 Answers, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 12 Jun 2007, 12:58 PM
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
0
Steve Attwell
Top achievements
Rank 1
answered on 25 Mar 2008, 07:48 PM
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.
0
Martin Vasilev
Telerik team
answered on 26 Mar 2008, 01:44 PM
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
Tags
General Discussions
Asked by
Gaurav
Top achievements
Rank 1
Answers by
Jack
Telerik team
Steve Attwell
Top achievements
Rank 1
Martin Vasilev
Telerik team
Share this question
or