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

📄 form2.frm

📁 文件传送
💻 FRM
字号:
VERSION 5.00
Begin VB.Form ChartFrm 
   BackColor       =   &H00E0E0E0&
   BorderStyle     =   1  'Fixed Single
   Caption         =   "简短消息发送窗口"
   ClientHeight    =   4710
   ClientLeft      =   5250
   ClientTop       =   1695
   ClientWidth     =   2475
   LinkTopic       =   "Form2"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   Moveable        =   0   'False
   ScaleHeight     =   4710
   ScaleWidth      =   2475
   ShowInTaskbar   =   0   'False
   Begin VB.Timer Timer1 
      Interval        =   50
      Left            =   180
      Top             =   1020
   End
   Begin VB.PictureBox Picture3 
      Height          =   555
      Left            =   1260
      Picture         =   "Form2.frx":0000
      ScaleHeight     =   495
      ScaleWidth      =   495
      TabIndex        =   6
      Top             =   180
      Visible         =   0   'False
      Width           =   555
   End
   Begin VB.PictureBox Picture2 
      Height          =   555
      Left            =   720
      Picture         =   "Form2.frx":1CFA
      ScaleHeight     =   495
      ScaleWidth      =   495
      TabIndex        =   5
      Top             =   180
      Visible         =   0   'False
      Width           =   555
   End
   Begin VB.PictureBox Picture1 
      Height          =   555
      Left            =   180
      Picture         =   "Form2.frx":39F4
      ScaleHeight     =   495
      ScaleWidth      =   495
      TabIndex        =   4
      Top             =   180
      Visible         =   0   'False
      Width           =   555
   End
   Begin VB.TextBox txtshow 
      Appearance      =   0  'Flat
      BackColor       =   &H00E0E0E0&
      Height          =   2955
      Left            =   0
      Locked          =   -1  'True
      MultiLine       =   -1  'True
      ScrollBars      =   2  'Vertical
      TabIndex        =   3
      ToolTipText     =   "这是聊天记录窗口"
      Top             =   0
      Width           =   2475
   End
   Begin 工程1.chameleonButton SendWord 
      Height          =   315
      Left            =   60
      TabIndex        =   1
      ToolTipText     =   "发送下面白色输入框中的文字给对方"
      Top             =   4380
      Width           =   2355
      _ExtentX        =   4154
      _ExtentY        =   556
      BTYPE           =   3
      TX              =   "发送"
      ENAB            =   0   'False
      BeginProperty FONT {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      COLTYPE         =   1
      FOCUSR          =   -1  'True
      BCOL            =   13160660
      FCOL            =   0
   End
   Begin VB.TextBox sendtext 
      Appearance      =   0  'Flat
      ForeColor       =   &H00FF8080&
      Height          =   1035
      Left            =   0
      MaxLength       =   255
      MultiLine       =   -1  'True
      ScrollBars      =   2  'Vertical
      TabIndex        =   0
      ToolTipText     =   "这是聊天消息发送窗口.你可以按下回车发送也可以点击下面的发送按钮来发送"
      Top             =   3300
      Width           =   2475
   End
   Begin VB.Image Image1 
      Height          =   255
      Left            =   2280
      MousePointer    =   8  'Size NW SE
      Top             =   4500
      Width           =   255
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "要发送的简短信息:"
      Height          =   255
      Left            =   0
      TabIndex        =   2
      Top             =   3060
      Width           =   1575
   End
End
Attribute VB_Name = "ChartFrm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Dim newx As Long
Dim newy As Long
Dim down As Boolean
Dim frmwidth As Long

Private Sub Form_Load()
ChartFrm.Icon = MainFrm.Icon
End Sub

Private Sub Image1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
    down = True
    newx = X
    newy = Y
End If
End Sub

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



If down = True Then


    frmwidth = Me.Width + (X - newx)
    
    If frmwidth > 2595 Or frmwidth = 2595 Then
        Me.Width = frmwidth
        Image1.Left = Me.Width - 370
        txtshow.Width = Me.Width - 120
        sendtext.Width = txtshow.Width
        SendWord.Width = Me.Width - 220
        
    End If
'    newx = X
End If
End Sub

Private Sub Image1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
down = False
End Sub

Private Sub SendWord_Click()


If sendtext.Text <> "" And MainFrm.Winsock1.state = 7 And MainFrm.Winsock2.state = 7 Then
    
    MainFrm.Winsock1.SendData str2byt(sendtext.Text, 2)
       
    txtshow.Text = sendtext.Text & vbCrLf & vbCrLf & txtshow.Text
    
    sendtext.Text = ""
    
ElseIf sendtext.Text = "" Then

    MainFrm.state.Caption = "不能发送空讯息"
    
    
End If
    
End Sub

Private Sub Form_Unload(cancel As Integer)
cancel = 1
ChartFrm.Hide
MainFrm.Chart.Caption = ">"
Timer1.Enabled = False
End Sub


Private Sub sendtext_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 Then

    Call SendWord_Click
    
    KeyAscii = 0
    
End If

End Sub

Private Sub Timer1_Timer()
ChartFrm.Top = MainFrm.Top
ChartFrm.Left = MainFrm.Left + MainFrm.Width
ChartFrm.Height = MainFrm.Height
End Sub

⌨️ 快捷键说明

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