軟件bug。vb點虐 創(chuàng)建是會有窗體進行應(yīng)用的,沒有應(yīng)用就是軟件bug原因,需要用戶將軟件關(guān)閉,點擊系統(tǒng)修復(fù)下載,再打開軟件即可。
成都創(chuàng)新互聯(lián)服務(wù)項目包括八步網(wǎng)站建設(shè)、八步網(wǎng)站制作、八步網(wǎng)頁制作以及八步網(wǎng)絡(luò)營銷策劃等。多年來,我們專注于互聯(lián)網(wǎng)行業(yè),利用自身積累的技術(shù)優(yōu)勢、行業(yè)經(jīng)驗、深度合作伙伴關(guān)系等,向廣大中小型企業(yè)、政府機構(gòu)等提供互聯(lián)網(wǎng)行業(yè)的解決方案,八步網(wǎng)站推廣取得了明顯的社會效益與經(jīng)濟效益。目前,我們服務(wù)的客戶以成都為中心已經(jīng)輻射到八步省份的部分城市,未來相信會繼續(xù)擴大服務(wù)區(qū)域并繼續(xù)獲得客戶的支持與信任!
'我試過可以,你試試
Imports System.Drawing
Imports System.Windows.Forms
Public Class Form1
'******************************************
Private oOriginalRegion As Region = Nothing
' 用于窗體移動
Private bFormDragging As Boolean = False
Private oPointClicked As Point
'******************************************
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown
Me.bFormDragging = True
Me.oPointClicked = New Point(e.X, e.Y)
End Sub
Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove
If Me.bFormDragging Then
Dim oMoveToPoint As Point
' 以當前鼠標位置為基礎(chǔ),找出目標位置
oMoveToPoint = Me.PointToScreen(New Point(e.X, e.Y))
' 根據(jù)開始位置作出調(diào)整
oMoveToPoint.Offset(Me.oPointClicked.X * -1, _
(Me.oPointClicked.Y + _
SystemInformation.CaptionHeight + _
SystemInformation.BorderSize.Height) * -1)
' 移動窗體
Me.Location = oMoveToPoint
End If
End Sub
Private Sub Form1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseUp
Me.bFormDragging = False
End Sub
End Class
錯誤提示是“索引超出了數(shù)組界限。”是Message="創(chuàng)建窗體時出錯。有關(guān)詳細信息,請參閱 Exception.InnerException。錯誤為: 索引超出了數(shù)組界限。"設(shè)置的,不能代表真實的問題,實際上程序能運行但可能程序要用到內(nèi)存硬盤、CPU序號等因素,不把整個程序拿出來很難解答
這樣的話你就不要直接把子窗口show出來,先在父窗口創(chuàng)建一個子窗口對象的變量,通過實例化該變量達到創(chuàng)建子窗口的目的,然后在下次又要打開子窗口時也可以通過該變量關(guān)閉原有的子窗口
示例代碼如下(假設(shè)Form1為父窗口,F(xiàn)orm2為子窗口):
Form1的代碼:
Public Class Form1
Dim nform As Form2 = Nothing
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If nform IsNot Nothing Then
nform.Close()
nform.Dispose()
End If
nform = New Form2
nform.Show()
Me.Hide()
End Sub
End Class
通過nform變量,你可以很輕易就處理掉原來已經(jīng)打開但隱藏著的子窗口了