bl双性强迫侵犯h_国产在线观看人成激情视频_蜜芽188_被诱拐的少孩全彩啪啪漫画

vb.net窗體半透明 vbnet web窗體

VB.NET 2005 如何做部分窗體透明

簡(jiǎn)單的部分透明比較難做,不過可以換個(gè)方式考慮一下。

創(chuàng)新互聯(lián)服務(wù)項(xiàng)目包括武定網(wǎng)站建設(shè)、武定網(wǎng)站制作、武定網(wǎng)頁(yè)制作以及武定網(wǎng)絡(luò)營(yíng)銷策劃等。多年來,我們專注于互聯(lián)網(wǎng)行業(yè),利用自身積累的技術(shù)優(yōu)勢(shì)、行業(yè)經(jīng)驗(yàn)、深度合作伙伴關(guān)系等,向廣大中小型企業(yè)、政府機(jī)構(gòu)等提供互聯(lián)網(wǎng)行業(yè)的解決方案,武定網(wǎng)站推廣取得了明顯的社會(huì)效益與經(jīng)濟(jì)效益。目前,我們服務(wù)的客戶以成都為中心已經(jīng)輻射到武定省份的部分城市,未來相信會(huì)繼續(xù)擴(kuò)大服務(wù)區(qū)域并繼續(xù)獲得客戶的支持與信任!

把本問題轉(zhuǎn)換成在VB.NET 2005環(huán)境下創(chuàng)建不規(guī)則窗體(=普通窗體 - 透明部分)問題,解決方法就很多了,網(wǎng)上也有許多例子。如 章立民 的書里就詳細(xì)講過。

大致思路如下:

1。將backgroundimage設(shè)成一個(gè)位圖(點(diǎn)陣圖)

2.將Transparaencykey設(shè)成位圖的背景顏色(位圖最取背景單純,單純部分將成為透明部分)

3.如需要可以將formborderstyle設(shè)為none,會(huì)移除標(biāo)題欄,并需要手動(dòng)編寫窗體移動(dòng)、關(guān)閉等動(dòng)作代碼,

半透明,請(qǐng)問在VB中如何使一個(gè)窗體半透明

Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long

Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long

Private Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hwnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long

Private Const gwl_exstyle = -20

Private Const lwa_alpha As Long = H2

Private Const ws_ex_layered As Long = H8000

Private Sub Form_Load()

Dim Fattri As Long

Call SetWindowLong(Me.hwnd, gwl_exstyle, Fattri Or ws_ex_layered)

Call SetLayeredWindowAttributes(Me.hwnd, 0, 200, lwa_alpha)

End Sub

vb窗體半透明了 但是文本框輸入的字也半透明了

你不用反復(fù)問這個(gè)問題了,VB很難實(shí)現(xiàn)的。要么窗體整體半透明(用LWA_ALPHA常數(shù)指定透明度),要么就窗體完全透明,控件不透明(用LWA_COLORKEY常數(shù)指定透明色)。不過你可以把兩種窗體結(jié)合使用,就是用一個(gè)半透明的窗體做背景,上面覆蓋一個(gè)同樣大小的完全透明(控件不透明)的窗體,曲線實(shí)現(xiàn)你的目的。

vb中如何使窗體半透明,控件不透明?

下面代碼能能使窗體透明,但控件不透明:

Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long

Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long

Private Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hwnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long

Private Const WS_EX_LAYERED = H80000

Private Const GWL_EXSTYLE = (-20)

Private Const WS_EX_TRANSPARENT = H20

Private Const LWA_ALPHA = H2

Private Const LWA_COLORKEY = H1

Private Sub Form_Load()

Dim rtn As Long, ctrol As Control

rtn = GetWindowLong(hwnd, GWL_EXSTYLE)

rtn = rtn Or WS_EX_TRANSPARENT

SetWindowLong hwnd, GWL_EXSTYLE, rtn

Me.Show

DoEvents

For Each ctrol In Me.Controls

ctrol.Refresh

Next

'SetLayeredWindowAttributes hwnd, 0, 100, LWA_ALPHA '100值可調(diào),0-255之間,越小透明度越高

'SetLayeredWindowAttributes hwnd, RGB(0, 0, 0), 0, LWA_COLORKEY '將窗體上的黑顏色去掉

End Sub

如何用VB實(shí)現(xiàn)半透明控件

Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long

Private Const WS_EX_LAYERED = H80000

Private Const GWL_EXSTYLE = (-20)

Private Const LWA_ALPHA = H2

Private Const LWA_COLORKEY = H1

Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long

Private Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hwnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long

Private Sub SetFormTranslucency(hwnd As Long, crKey As Long, bAlpha As Byte, dwFlags As Long)'實(shí)現(xiàn)半透明窗體

Dim rtn As Long

rtn = GetWindowLong(hwnd, GWL_EXSTYLE)

rtn = rtn Or WS_EX_LAYERED

SetWindowLong hwnd, GWL_EXSTYLE, rtn

SetLayeredWindowAttributes hwnd, crKey, bAlpha, dwFlags

End Sub

Private Sub Form_Load()

Call SetFormTranslucency(Me.hwnd, 0, 200, 2) '窗體半透明,200為透明值

End Sub

可以實(shí)現(xiàn)窗體和窗體上的控件全都半透明,透明度可調(diào)

在vb中,如何把半透明窗體(仿Vista)應(yīng)用于同一程序所有的窗體,使它們都變成半透明的

添加一個(gè)公共模塊 添加如下代碼

Public Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long

Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long

Public Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hwnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long

Public Const WS_EX_LAYERED = H80000

Public Const GWL_EXSTYLE = (-20)

Public Const LWA_ALPHA = H1

---------------------------------------------

再在每一個(gè)窗體的代碼上添加如下代碼

注意,窗體上有三個(gè)控件,text1,command1,label1,這些都是半透明的

Private Sub Form_Load()

Me.BackColor = vbWhite

Text1.BackColor = vbWhite

Command1.BackColor = vbWhite

Label1.BackColor = vbWhite

Dim rtn As Long

rtn = GetWindowLong(hwnd, GWL_EXSTYLE)

rtn = rtn Or WS_EX_LAYERED

SetWindowLong hwnd, GWL_EXSTYLE, rtn

SetLayeredWindowAttributes hwnd, vbWhite, 150, 2 '最后一個(gè)參數(shù)為 1 時(shí), 是 挖去 第二個(gè)參數(shù)指定的色,第3個(gè)設(shè)置透明度的參數(shù)無效, 最后一個(gè)參數(shù)為 2時(shí),第2個(gè)參數(shù)無效,第3個(gè)參數(shù)有效 設(shè)置透明度范圍 【0,255】

End Sub

------------------------------------

我沒用過vista,不知是否是同一個(gè)效果

文章標(biāo)題:vb.net窗體半透明 vbnet web窗體
本文URL:http://vcdvsql.cn/article26/hhhocg.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站改版品牌網(wǎng)站設(shè)計(jì)電子商務(wù)、小程序開發(fā)外貿(mào)網(wǎng)站建設(shè)手機(jī)網(wǎng)站建設(shè)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

成都網(wǎng)站建設(shè)公司