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出的新窗口。

  • 相关阅读:
    静态化之优化
    SEO小技巧
    apache 工具和简单优化
    apache rewrite机制
    nginx php win平台配置
    mvc 简单模型
    php无限分类三种方式
    【转】sqlserver查询数据库中有多少个表
    【转】sqlserver数据库之间的表的复制
    SET ANSI_NULLS (TransactSQL)
  • 原文地址:https://www.cnblogs.com/danieldong/p/5342702.html
Copyright © 2011-2022 走看看