基本信息
源码名称:在wpf中创建一个不规则形状的窗口
源码大小:0.10M
文件格式:.zip
开发语言:C#
更新时间:2018-11-22
友情提示:(无需注册或充值,赞助后即可获取资源下载链接)
嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300
本次赞助数额为: 3 元×
微信扫码支付:3 元
×
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
源码介绍
'******************************** Module Header ***********************************' 'Module Name: WPFIrregularShapeWindow.xaml.vb 'Project: VBWPFIrregularShapeWindow 'Copyright (c) Microsoft Corporation. ' 'The WPFIrregularShapeWindow.xaml.vb file defines a MainWindow Class inherited windows Class is 'responsible for showing which present five irregular shape window ' 'This source is subject to the Microsoft Public License. 'See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL. 'All other rights reserved. ' 'THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 'EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF 'MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. '**********************************************************************************' Imports System.Text ''' <summary> ''' Interaction logic for MainWindow.xaml ''' </summary> Partial Public Class WPFIrregularShapeWindow Inherits Window Public AdditionHeight As Integer Public AdditionWidth As Integer Public Sub New() InitializeComponent() End Sub Private Sub Window_Click(ByVal sender As Object, ByVal e As RoutedEventArgs) ' Generate random number added to the child windows's width and height in order to not be overlapped each other. Dim ro As New Random() AdditionHeight = ro.Next(500) AdditionWidth = ro.Next(500) Dim btn As Button = TryCast(e.Source, Button) If btn IsNot Nothing Then Select Case TryCast(btn.Tag, String) Case "Ellipse Window" Dim ellipseWindow_Renamed As New EllipseWindow() ' Show the child windows individually ellipseWindow_Renamed.Left = Me.Left Me.Width AdditionWidth ellipseWindow_Renamed.Top = Me.Top Me.Height AdditionHeight ellipseWindow_Renamed.Show() Case "Rounded Corners Window" Dim roundedCornersWindow_Renamed As New RoundedCornersWindow() ' Show the child windows individually roundedCornersWindow_Renamed.Left = Me.Left Me.Width AdditionWidth roundedCornersWindow_Renamed.Top = Me.Top Me.Height AdditionHeight roundedCornersWindow_Renamed.Show() Case "Triangle Corners Window" Dim triangleCornersWindow_Renamed As New TriangleCornersWindow() ' Show the child windows individually triangleCornersWindow_Renamed.Left = Me.Left Me.Width AdditionWidth triangleCornersWindow_Renamed.Top = Me.Top AdditionHeight triangleCornersWindow_Renamed.Show() Case "Popup Corners Window" Dim popupCornersWindow_Renamed As New PopupCornersWindow() ' Show the child windows individually popupCornersWindow_Renamed.Left = Me.Left AdditionWidth popupCornersWindow_Renamed.Top = Me.Top AdditionHeight popupCornersWindow_Renamed.Show() Case "Picture Based Windows" Dim picturebasedWindows As New PictureBasedWindow() ' Show the child windows individually picturebasedWindows.Left = Me.Left AdditionWidth picturebasedWindows.Top = Me.Top AdditionHeight picturebasedWindows.Show() Case Else End Select End If End Sub End Class