일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
- tkinter Radio 동적버튼
- Django
- python
- flask
- Django-allauth
- FastAPI
- numpy
- array
- check_password
- SQL
- allauth
- for loop
- graphene-django
- GraphQL
- Today
- Total
객
[ vb 2008 ] 투명창 예제 본문
<Window x:Class="Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="314" Width="485" Name="Window1">
<Grid></Grid>
</Window>
Imports System
Imports System.Windows.Interop
Imports System.Runtime.InteropServices
Public Class Window1
<StructLayout(LayoutKind.Sequential)> _
Public Structure MARGINS
Public cxLeftWidth As Integer
Public cxRightWidth As Integer
Public cyTopHeight As Integer
Public cyButtomheight As Integer
End Structure
<DllImport("dwmapi.dll")> _
Public Shared Function DwmExtendFrameIntoClientArea(ByVal hWnd As IntPtr, ByRef pMarinset As MARGINS) As Integer
End Function
Private Sub Window1_Loaded(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles MyBase.Loaded
on Error Resume Next
Dim margins As MARGINS = New MARGINS
Me.Title = "투명창 예제"
margins.cxLeftWidth = -1
margins.cxRightWidth = -1
margins.cyTopHeight = -1
margins.cyButtomheight = -1
'set all the four value -1 to apply glass effect to the whole window
'set your own value to make specific part of the window glassy.
Dim hwnd As IntPtr = New WindowInteropHelper(Window1).Handle
If Not hwnd = 0 Then
Throw New InvalidProgramException("The Window must be shown before glass")
End If
Window1.Background = Brushes.Transparent
HwndSource.FromHwnd(hwnd).CompositionTarget.BackgroundColor = Colors.Transparent
Dim result As Integer = DwmExtendFrameIntoClientArea(hwnd, margins)
End Sub
End Clas
[ 실행 화면 ]
참고 사이트 : dotnetmvp.tistory.com
: taedi.kr
MSDN
'[PL] > VB & VB.NET' 카테고리의 다른 글
[ VB 2008 ] DrawLine 예제 (0) | 2010.01.08 |
---|---|
[ VB 2008 ]외부 프로그램 실행 하기........ (0) | 2010.01.07 |
[ vb 2008 ] Calendar 예제 (0) | 2010.01.05 |
[ vb 2008 ] Element:Shape (Line) (0) | 2010.01.05 |
[ vb 2008 ] Ellipse 예제 (0) | 2010.01.05 |