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

📄 frmpesan.frm

📁 Billing Internet Cafe
💻 FRM
字号:
VERSION 5.00
Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0"; "RICHTX32.OCX"
Begin VB.Form FrmPesan 
   BackColor       =   &H00EFF2EC&
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Pesan / Message"
   ClientHeight    =   5385
   ClientLeft      =   45
   ClientTop       =   465
   ClientWidth     =   7140
   Icon            =   "FrmPesan.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   5385
   ScaleWidth      =   7140
   StartUpPosition =   2  'CenterScreen
   Begin VB.CommandButton CmdHapusLog 
      Caption         =   "Hapus"
      Height          =   495
      Left            =   360
      TabIndex        =   3
      Top             =   4560
      Width           =   1335
   End
   Begin VB.CommandButton CmdKirim 
      Caption         =   "Kirim"
      Height          =   495
      Left            =   2880
      TabIndex        =   4
      Top             =   4560
      Width           =   1335
   End
   Begin VB.CommandButton CmdTutup 
      Caption         =   "Tutup"
      Height          =   495
      Left            =   5280
      TabIndex        =   5
      Top             =   4560
      Width           =   1335
   End
   Begin VB.TextBox TxtPesanDiKirim 
      Height          =   375
      Left            =   480
      TabIndex        =   1
      Top             =   3600
      Width           =   3975
   End
   Begin VB.ComboBox TxtNoClient 
      Height          =   315
      Left            =   5640
      TabIndex        =   2
      Top             =   3600
      Width           =   1095
   End
   Begin VB.Frame Frame3 
      Height          =   855
      Left            =   120
      TabIndex        =   8
      Top             =   4320
      Width           =   6855
   End
   Begin VB.Frame Frame2 
      Height          =   855
      Left            =   120
      TabIndex        =   7
      Top             =   3360
      Width           =   6855
      Begin VB.Label Label1 
         BackStyle       =   0  'Transparent
         Caption         =   "Client"
         BeginProperty Font 
            Name            =   "OCR A Extended"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   4680
         TabIndex        =   9
         Top             =   240
         Width           =   615
      End
   End
   Begin VB.Frame Frame1 
      Height          =   3135
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   6855
      Begin RichTextLib.RichTextBox TxtpesanDiterima 
         Height          =   2775
         Left            =   120
         TabIndex        =   6
         Top             =   240
         Width           =   6615
         _ExtentX        =   11668
         _ExtentY        =   4895
         _Version        =   393217
         Enabled         =   -1  'True
         ReadOnly        =   -1  'True
         ScrollBars      =   3
         Appearance      =   0
         TextRTF         =   $"FrmPesan.frx":B532
      End
   End
End
Attribute VB_Name = "FrmPesan"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Const HWND_TOPMOST = -1
Const SWP_NOSIZE = &H1
Private Declare Sub SetWindowPos Lib "user32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long)
Private Declare Function BringWindowToTop Lib "user32" (ByVal hWnd As Long) As Long
Private Sub CmdHapusLog_Click()
    TxtpesanDiterima.Text = ""
    TxtpesanDiterima.SaveFile ("Temp.txt")
End Sub

Private Sub CmdKirim_Click()
On Error Resume Next
    If FrmMain.Winsock(Val(TxtNoClient.Text)).State = sckConnected Then
        FrmMain.Winsock(Val(TxtNoClient.Text)).SendData "pesan|" & TxtPesanDiKirim.Text
        TxtPesanDiKirim.Text = ""
    End If
End Sub

Private Sub CmdTutup_Click()
    Unload Me
End Sub

Private Sub Form_Activate()
On Error GoTo hell
    Call CekClientAktif
hell:
    If err.Number = 5 Then
    Unload Me
    End If
End Sub

Private Sub Form_Load()
BringWindowToTop Me.hWnd
SetWindowPos Me.hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE
End Sub

Private Sub Form_Unload(Cancel As Integer)
    FrmPesanLoad = False
End Sub
Private Sub CekClientAktif()
On Error Resume Next
    Dim sql As String
    sql = "SELECT socket.* FROM socket"
    cn.Open
    cmd.ActiveConnection = cn
    cmd.CommandType = adCmdText
    cmd.CommandText = sql
    cmd.Execute
    rs.ActiveConnection = cn
    rs.Open sql, cn, adOpenStatic, adLockOptimistic
    If Not rs.RecordCount = 0 Then
        rs.MoveFirst
        For i = 1 To rs.RecordCount
            TxtNoClient.AddItem rs(1)
            rs.MoveNext
        Next i
        TxtNoClient.ListIndex = 0
        CmdKirim.Enabled = True
    Else
        CmdKirim.Enabled = False
    End If
    cn.Close
End Sub


Private Sub TxtPesanDiKirim_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Call CmdKirim_Click
End If
End Sub

⌨️ 快捷键说明

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