zoukankan      html  css  js  c++  java
  • WPF—QQ界面(四):单击QQ昵称弹出个人简介窗口的效果实现

    效果分析:当鼠标左键单击QQ的昵称时,会弹出另一个关于个人信息的窗口。

    此处用到的是Popup。

    设置鼠标触发Popup事件,该事件触发会跳转到另一个自定义窗口。

    前台代码:

    <Button Content="邓不利东" FontSize="24" FontStyle="Normal" Foreground="Black" Background="Transparent" BorderBrush="Transparent"
                        Cursor="Hand" Click="Popup_CP_Click"/>

    后台Popup_CP_Click的事件触发:

    private void Popup_CP_Click(object sender, RoutedEventArgs e)   
            {
                MyProfile myprofile = new MyProfile();
                myprofile.ShowDialog();
            }

    触发事件中MyProfile myprofile = new MyProfile(); 是新建一个MyProfile的窗口,因此,我们新建窗口的时候,将 Title 设为 MyProfile 即可。

    如下:

    <Window x:Class="QQ_presentation.MyProfile"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            Title="MyProfile" Height="700" Width="560"
            ResizeMode="NoResize">

    此时就能将主窗口与自定义窗口建立连接了,用Popup弹出自定义窗口。

    最终效果图如下:

    右图即为Popup出的新窗口。

  • 相关阅读:
    Windows Phone MultiBinding :Cimbalino Toolkit
    Instant Django 1.5 Application Development Starter
    Writing your first Django
    Python urllib2 proxy
    TED Notes 1 (What leads to success)
    Py2.7 no module named tkinter
    某培训的笔记
    “假学习”和“真学习”[转]
    Selenium学习笔记
    反思之一
  • 原文地址:https://www.cnblogs.com/danieldong/p/5342702.html
Copyright © 2011-2022 走看看