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

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

vb.net無邊框拖動 c#無邊框拖動

VB.net怎樣按住鼠標(biāo)移動無邊框窗體

當(dāng)用戶按下左鍵時,為按下對象的MouseMove事件綁定處理方法,并記錄鼠標(biāo)坐標(biāo)(窗體左上角為原點,在事件的MouseEventArgs類型的e參數(shù)中提供)。此時用戶移動鼠標(biāo),保持窗體原點與鼠標(biāo)新坐標(biāo)的相對位置不變。當(dāng)用戶釋放左鍵時,撤銷按下對象的MouseMove事件處理方法

創(chuàng)新互聯(lián)建站長期為1000多家客戶提供的網(wǎng)站建設(shè)服務(wù),團隊從業(yè)經(jīng)驗10年,關(guān)注不同地域、不同群體,并針對不同對象提供差異化的產(chǎn)品和服務(wù);打造開放共贏平臺,與合作伙伴共同營造健康的互聯(lián)網(wǎng)生態(tài)環(huán)境。為建陽企業(yè)提供專業(yè)的成都網(wǎng)站建設(shè)、成都做網(wǎng)站,建陽網(wǎng)站改版等技術(shù)服務(wù)。擁有十余年豐富建站經(jīng)驗和眾多成功案例,為您定制開發(fā)。

vbnet 無邊框 拖動

[DllImport("user32.dll")]

public static extern bool ReleaseCapture();

[DllImport("user32.dll")]

public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);

public const int WM_SYSCOMMAND = 0x0112;

public const int SC_MOVE = 0xF010;

public const int HTCAPTION = 0x0002;

private void LoginFrm_MouseDown(object sender, MouseEventArgs e)

{

ReleaseCapture();

SendMessage(this.Handle, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0);

}

VB的代碼我不是很明白

VB.NET 拖動無邊框窗體編程實例

Imports System Drawing Imports System Windows Forms ****************************************** Private oOriginalRegion As Region = Nothing 用于窗體移動 Private bFormDragging As Boolean = False Private oPointClicked As Point ****************************************** Private Sub Form _MouseDown(ByVal sender As Object ByVal e As System Windows Forms MouseEventArgs) Handles MyBase MouseDown Me bFormDragging = True Me oPointClicked = New Point(e X e Y) End Sub ****************************************** Private Sub Form _MouseUp(ByVal sender As Object ByVal e As System Windows Forms MouseEventArgs) Handles MyBase MouseUp Me bFormDragging = False End Sub ****************************************** Private Sub Form _MouseMove(ByVal sender As Object ByVal e As System Windows Forms MouseEventArgs) Handles MyBase MouseMove If Me bFormDragging Then Dim oMoveToPoint As Point 以當(dāng)前鼠標(biāo)位置為基礎(chǔ) 找出目標(biāo)位置 oMoveToPoint = Me PointToScreen(New Point(e X e Y)) 根據(jù)開始位置作出調(diào)整 oMoveToPoint Offset(Me oPointClicked X * _ (Me oPointClicked Y + _ SystemInformation CaptionHeight + _ SystemInformation BorderSize Height) * ) 移動窗體 Me Location = oMoveToPoint End If

lishixinzhi/Article/program/ASP/201311/21755

VB.NET如何實現(xiàn)無邊框窗體拖動? 如果能指定控件拖動更好 希望能有一點分析 使用VS2015

VB6.0寫的,代碼很簡單,無意中寫成的。應(yīng)該可以參考。不需要任何api函數(shù)。在無邊框窗體頂部中放入一個label標(biāo)簽。然后用label的 mouse down 和mouse move事件實現(xiàn)

Dim a, b As Single

Private Sub Label1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)

a = X

b = Y

End Sub

Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

If Button = 1 Then

Form1.Move Left + X - a, Top + Y - b

End If

End Sub


網(wǎng)站題目:vb.net無邊框拖動 c#無邊框拖動
文章出自:http://weahome.cn/article/dohgcjs.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部