⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form7.frm

📁 用vb编的网络聊天程序
💻 FRM
📖 第 1 页 / 共 2 页
字号:
            Left            =   468
            TabIndex        =   18
            Top             =   288
            Width           =   1596
         End
      End
      Begin VB.Frame Frame3 
         Caption         =   "Sending and receiving"
         Height          =   948
         Left            =   144
         TabIndex        =   14
         Top             =   252
         Width           =   5556
         Begin VB.CheckBox Check5 
            Caption         =   "Automatically receive"
            Height          =   228
            Left            =   180
            TabIndex        =   16
            Top             =   612
            Width           =   4440
         End
         Begin VB.CheckBox Check4 
            Caption         =   "Automatically send"
            Height          =   228
            Left            =   180
            TabIndex        =   15
            Top             =   288
            Width           =   5232
         End
      End
   End
End
Attribute VB_Name = "Form7"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private mTabIndex As Long

Private Sub Check1_Click()
    On Error GoTo ErrorHandle
    If Visible Then NotImplement
    Exit Sub
    
ErrorHandle:
    ShowErr
End Sub

Private Sub Check2_Click()
    On Error GoTo ErrorHandle
    If Visible Then NotImplement
    Exit Sub
    
ErrorHandle:
    ShowErr
End Sub

Private Sub Command1_Click()
    
    On Error GoTo ErrorHandle
    MousePointer = vbHourglass
    
    Dim s As String
    s = Trim$(Text1)
    If Len(s) <= 0 Then Err.Raise 5, , "Invalid name."
    gstrMyName = s
    
    s = Trim$(Text2)
    If InStr(s, "@") = 0 Or InStr(s, ".") = 0 Then Err.Raise 5, , "Invalid email"
    gstrMyEmail = s
    
    gblnAutoStart = Check1 = vbChecked
    gblnShellIcon = Check2 = vbChecked
    
    Form1.AudioSend = Check3 = vbChecked
    
    If Option1(0).Tag Then
        
        'if size changed
        Dim l As Long
        For l = 0 To Option1.Count - 1
            If Option1(l) Then Exit For
        Next
        Form1.VideoFormat = l
    End If
    
    Form1.VideoSend = Check4 = vbChecked
    Form1.VideoRece = Check5 = vbChecked
    
    Form1.VidCodec1.Quality = HScroll1
    gblnHighSpeed = HScroll1.Max > 50
    If Combo1.ListIndex >= 0 Then Form1.VideoDevice = Combo1.ListIndex
    
    SetAppSettings
    
UnloadMe:
    Unload Me

ExitSub:
    MousePointer = vbDefault
    Exit Sub
    
ErrorHandle:
    If MsgBox("Error: " & Err.Description & vbCrLf & "Not all parameters were set, continue?", vbExclamation + vbYesNo) = vbYes Then
        Resume UnloadMe
    Else
        Resume ExitSub
    End If
End Sub

Private Sub Command2_Click()
    On Error GoTo ErrorHandle
    Unload Me
    Exit Sub
    
ErrorHandle:
    ShowErr
End Sub

Friend Property Let TabIndex(ByVal Index As Integer)
    mTabIndex = Index
End Property

Private Sub Command3_GotFocus(Index As Integer)
    On Error GoTo ErrorHandle

    'show the frame control with the same index
    Dim l As Long
    For l = 0 To Frame1s.Count - 1
        Frame1s(l).Visible = Frame1s(l).Index = Index
    Next
    Command3(Index).ZOrder

    'set current index
    mTabIndex = Index
    
    'move focus to next control
    PostMessage hwnd, &H208, 0, 0
    Exit Sub
    
ErrorHandle:
    ShowErr
End Sub

Private Sub Command4_Click()
    On Error GoTo ErrorHandle
    Select Case MsgBox("Are you using a high speed newwork?" & vbCrLf & vbCrLf & _
        "Press ""Yes"" for high speed LAN connection, ""No"" for low speed modem to modem (less than 33k) connection.", vbYesNoCancel + vbQuestion + IIf(HScroll1.Max > 50, vbDefaultButton1, vbDefaultButton2))
    Case vbYes
        Dim b As Boolean
        b = True
    Case vbNo
        b = False
    End Select
    
    Dim l As Long
    l = HScroll1 * 100 / HScroll1.Max
    HScroll1.Max = IIf(b, 99, 50)
    HScroll1 = l * IIf(b, 99, 50) / 100
    Exit Sub
    
ErrorHandle:
    ShowErr
End Sub

Private Sub Command5_Click()
    On Error GoTo ErrorHandle
    Form8.Show vbModal, Me
    Exit Sub
    
ErrorHandle:
    ShowErr
End Sub

Private Sub Command6_Click()
    On Error GoTo ErrorHandle
    Form1.AudioCompressorDlg
    Exit Sub
    
ErrorHandle:
    If Err <> 32755 Then ShowErr
End Sub

Private Sub Command7_Click()
    On Error GoTo ErrorHandle
    Form1.VideoSourceDlg
    Exit Sub
    
ErrorHandle:
    If Err <> 32755 Then ShowErr
End Sub

Private Sub Command8_Click()
    On Error GoTo ErrorHandle
    Form1.VideoFormatDlg
    
    'reset size changing flag
    Option1(0).Tag = False
    Exit Sub
    
ErrorHandle:
    If Err <> 32755 Then ShowErr
End Sub

Private Sub Command9_Click()
    On Error GoTo ErrorHandle
    Form1.VideoCompressorDlg
    Exit Sub
    
ErrorHandle:
    If Err <> 32755 Then ShowErr
End Sub

Private Sub Form_Activate()
    On Error GoTo ErrorHandle
    Command3(mTabIndex).SetFocus
    Exit Sub
    
ErrorHandle:
    ShowErr
End Sub


Private Sub Form_Load()
    On Error GoTo ErrorHandle
    
    Command3(0).Value = True
    
    Dim v As Variant
    For Each v In Form1.VidCap1.Devices
        Combo1.AddItem v
    Next
    
    Text1 = gstrMyName
    Text2 = gstrMyEmail
    
    Check1 = IIf(gblnShellIcon, vbChecked, vbUnchecked)
    Check2 = IIf(gblnShellIcon, vbChecked, vbUnchecked)
    
    Check3 = IIf(Form1.AudioSend, vbChecked, vbUnchecked)
    
    Check4 = IIf(Form1.VideoSend, vbChecked, vbUnchecked)
    Check5 = IIf(Form1.VideoRece, vbChecked, vbUnchecked)
    
    Option1(Form1.VideoFormat) = True
    Option1(0).Tag = False
    
    HScroll1.Max = IIf(gblnHighSpeed, 99, 50)
    HScroll1.Min = 0
    HScroll1.LargeChange = 10
    HScroll1 = Form1.VidCodec1.Quality
    
    Dim l As Long
    l = Form1.VideoDevice
    If l >= 0 Then Combo1.ListIndex = l
    Exit Sub
    
ErrorHandle:
    ShowErr
End Sub

Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    On Error GoTo ErrorHandle
    If Button = vbMiddleButton Then SendKeys "{TAB}", True
    Exit Sub
    
ErrorHandle:
    ShowErr
End Sub

Private Sub Option1_Click(Index As Integer)
    On Error GoTo ErrorHandle
    Option1(0).Tag = True
    Exit Sub
    
ErrorHandle:
    ShowErr
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -