真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

vb.net繪制窗體陰影 vb窗體的顯示和隱藏方法

VB.NET窗體陰影

vb.net2008

創(chuàng)新互聯(lián)建站2013年開創(chuàng)至今,先為磁縣等服務(wù)建站,磁縣等地企業(yè),進行企業(yè)商務(wù)咨詢服務(wù)。為磁縣企業(yè)網(wǎng)站制作PC+手機+微官網(wǎng)三網(wǎng)同步一站式服務(wù)解決您的所有建站問題。

vb.net API 是將除特殊變量(如H20000)的Long都改成Integer

窗體的右側(cè)和下方有陰影

Public Class Form1

Private Const CS_DROPSHADOW = H20000

Private Const GCL_STYLE = (-26)

Private Declare Function GetClassLong Lib "user32" Alias "GetClassLongA" (ByVal hwnd As Integer, ByVal nIndex As Integer) As Integer

Private Declare Function SetClassLong Lib "user32" Alias "SetClassLongA" (ByVal hwnd As Integer, ByVal nIndex As Integer, ByVal dwNewLong As Long) As Integer

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

SetClassLong(Me.Handle, GCL_STYLE, GetClassLong(Me.Handle, GCL_STYLE) Or CS_DROPSHADOW)

End Sub

End Class

Vb.net 無邊框窗體如何實現(xiàn)四周陰影? 網(wǎng)上搜到的都是兩邊陰影的,我需要四周陰影

設(shè)置全局變量:

Dim?drag?As?Boolean

Dim?mousex?As?Integer

Dim?mousey?As?Integer

假設(shè)你想拖動的是Panel1控件,以及此控件上的?Label1(用于顯示標(biāo)題)和PictureBox4(用于顯示圖標(biāo)):

Private?Sub?TitleMove_MouseDown(sender?As?Object,?e?As?System.Windows.Forms.MouseEventArgs)?Handles?Panel1.MouseDown,?Label1.MouseDown,?PictureBox4.MouseDown

drag?=?True

mousex?=?Windows.Forms.Cursor.Position.X?-?Me.Left

mousey?=?Windows.Forms.Cursor.Position.Y?-?Me.Top

End?Sub

Private?Sub?TitleMove_MouseMove(sender?As?Object,?e?As?System.Windows.Forms.MouseEventArgs)?Handles?Panel1.MouseMove,?Label1.MouseMove,?PictureBox4.MouseMove

If?drag?Then

Me.Top?=?Windows.Forms.Cursor.Position.Y?-?mousey

Me.Left?=?Windows.Forms.Cursor.Position.X?-?mousex

End?If

End?Sub

Private?Sub?TitleMove_MouseUp(sender?As?Object,?e?As?System.Windows.Forms.MouseEventArgs)?Handles?Panel1.MouseUp,?Label1.MouseUp,?PictureBox4.MouseUp

drag?=?False

End?Sub

VB.NET里面要使無邊框的窗體有陰影該怎么做

調(diào)用系統(tǒng)API使窗體下?lián)碛嘘幱靶Ч?/p>

using System.Runtime.InteropServices;

然后再窗口類的隨便哪個地方加上:

const int CS_DROPSHADOW = 0x20000;

const int GCL_STYLE = (-26);

//聲明Win32 API

[DllImport("user32.dll", CharSet = CharSet.Auto)]

public static extern int SetClassLong(IntPtr hwnd,int nIndex,int dwNewLong);

[DllImport("user32.dll", CharSet = CharSet.Auto)]

public static extern int GetClassLong(IntPtr hwnd, int nIndex);

最后在窗體的構(gòu)造函數(shù)中加上:

SetClassLong(this.Handle, GCL_STYLE, GetClassLong(this.Handle, GCL_STYLE) | CS_DROPSHADOW);

vbnet自制窗體怎么加上窗體陰影

Public Class Form1

Private Const CS_DROPSHADOW = H20000

Private Const GCL_STYLE = (-26)

Private Declare Function GetClassLong Lib "user32" Alias "GetClassLongA" (ByVal hwnd As Integer, ByVal nIndex As Integer) As Integer

Private Declare Function SetClassLong Lib "user32" Alias "SetClassLongA" (ByVal hwnd As Integer, ByVal nIndex As Integer, ByVal dwNewLong As Integer) As Integer

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

SetClassLong(Me.Handle, GCL_STYLE, GetClassLong(Me.Handle, GCL_STYLE) Or CS_DROPSHADOW)


當(dāng)前標(biāo)題:vb.net繪制窗體陰影 vb窗體的顯示和隱藏方法
轉(zhuǎn)載注明:http://weahome.cn/article/dohheid.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部