Frage

Please can you help me how can i create popup panel with informations for mouseover. I using C# offline application.

I don't know how can i do this on mouseover with application. For website it is javascript but for C# ... i don't know.

I know how to use mouseover for it, but i don't know how to create popup window with informations for mouseover. It's exactly my problem. Please can you help me?

Screen Shot

War es hilfreich?

Lösung

You could start by testing the following:

You can use MouseEnter to show a window in a popup style.

    private void panel1_MouseEnter(object sender, System.EventArgs e) 
    {
        MyForm frm = new MyForm();
        frm.ShowDialog();
    }

When you require behavior like jquery UI Tooltip you can use UserControl

    private Control popup;

    private void panel1_MouseEnter(object sender, System.EventArgs e) 
    {
        MyUserControl mcu = new MyUserControl ();
        this.popup =mcu; //save references to new control
        this.Controls.Add(this.popup);
        this.popup.Location.X = ((Control)sender).Location.X+ offsetX; 
        this.popup.Location.Y = ((Control)sender).Location.Y+ offsetY;


    }

    private void panel1_MouseLeave(object sender, System.EventArgs e) 
    {
        this.Controls.Remove(this.popup);
    }

Andere Tipps

This sounds suspiciously like a ToolTip. So I recommend that you use the ToolTipService for this (in your xaml):

<object>
  <ToolTipService.ToolTip>
    <objectThatFillsTheToolTip .../>
  </ToolTipService.ToolTip>
</object>

This sample is from the msdn docu page.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top