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

📄 信息(简).frm

📁 我们公司生产线大屏幕的程序.是用visual basic语言编写的.
💻 FRM
📖 第 1 页 / 共 2 页
字号:
VERSION 5.00
Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX"
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form send 
   Caption         =   "数据发送"
   ClientHeight    =   3510
   ClientLeft      =   3630
   ClientTop       =   1350
   ClientWidth     =   4200
   Icon            =   "信息(简).frx":0000
   LinkTopic       =   "Form1"
   ScaleHeight     =   3510
   ScaleWidth      =   4200
   Begin MSWinsockLib.Winsock tcpClient 
      Left            =   3840
      Top             =   120
      _ExtentX        =   741
      _ExtentY        =   741
      _Version        =   393216
   End
   Begin VB.TextBox Text2 
      Height          =   270
      Left            =   2520
      TabIndex        =   5
      Text            =   "Text2"
      Top             =   180
      Width           =   1455
   End
   Begin VB.Timer Timer1 
      Interval        =   5000
      Left            =   3720
      Top             =   3120
   End
   Begin VB.TextBox Text1 
      Appearance      =   0  'Flat
      BorderStyle     =   0  'None
      Height          =   270
      Left            =   3360
      TabIndex        =   3
      Top             =   2880
      Visible         =   0   'False
      Width           =   855
   End
   Begin VB.PictureBox Picture1 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BorderStyle     =   0  'None
      ForeColor       =   &H80000008&
      Height          =   1815
      Left            =   120
      ScaleHeight     =   1815
      ScaleWidth      =   3855
      TabIndex        =   1
      Top             =   1560
      Width           =   3855
   End
   Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1 
      Height          =   855
      Left            =   0
      TabIndex        =   2
      Top             =   600
      Width           =   4215
      _ExtentX        =   7435
      _ExtentY        =   1508
      _Version        =   393216
      Rows            =   3
      Cols            =   4
      RowHeightMin    =   1
      FillStyle       =   1
      ScrollBars      =   2
      FormatString    =   " 文件名 |<停留时间|<显示方式|<时间显示"
   End
   Begin VB.CommandButton sendst 
      Caption         =   "传送保存"
      Height          =   375
      Left            =   0
      TabIndex        =   0
      Top             =   120
      Width           =   975
   End
   Begin VB.Label Label2 
      Caption         =   "显示屏IP地址:"
      Height          =   255
      Left            =   1200
      TabIndex        =   6
      Top             =   240
      Width           =   1215
   End
   Begin VB.Label Label1 
      Caption         =   "Label1"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1695
      Left            =   120
      TabIndex        =   4
      Top             =   1560
      Width           =   3975
   End
End
Attribute VB_Name = "send"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Type SHOWMODE
    fileName As String
    pausetime As Byte
    dsmode As Byte
    dsclock As Byte
End Type
Dim show_max As Long
Dim show_current As Long
Dim myshowmode(50) As SHOWMODE
Const PORT = 1000
Private Type BITMAPFILEHEADER
        bftype As Integer
        bfsize As Long
        bfreserved1 As Integer
        bfreserved2 As Integer
        bfoffbits As Long
    End Type
    
    Private Type BITMAPINFOHEADER
        bisize As Long
        biwidth As Long
        biheight As Long
        biplanes As Integer
        bibitcount As Integer
        bicompress As Long
        bisizeimage As Long
        bixpeispermeter As Long
        biypeispermeter As Long
        bicirused As Long
        bicirimprotant As Long
    End Type
Dim ip_adr  As String
Dim string_s As Boolean
Dim OutString As String
Dim outbytes() As Byte
Dim njh, nwc, yjh, ywc, rjh, rwc, jp, error_inf


Private Sub Form_Unload(Cancel As Integer)
End
End Sub

Private Sub sendst_Click()
Dim i
    Timer1.Enabled = False
    写设置
    For i = 0 To show_max - 1
        Call sendbmp(myshowmode(i).fileName, i + 1)
    Next i
    ReDim outbytes(show_max * 4 + 3)
    
    outbytes(0) = Asc("C")
    outbytes(1) = Asc("T")
    outbytes(2) = Asc("L")
    
    For i = 0 To show_max - 1
        outbytes(4 * i + 3) = myshowmode(i).dsmode + 99
        outbytes(4 * i + 4) = i + 1
        outbytes(4 * i + 5) = myshowmode(i).dsclock + 100
        outbytes(4 * i + 6) = myshowmode(i).pausetime * 14
      Next i
    outbytes(show_max * 4 + 3) = 255
    string_s = False
    On Error Resume Next
    If tcpClient.State <> sckClosed Then _
    tcpClient.Close
    tcpClient.Connect ip_adr, PORT
    Do Until tcpClient.State = sckClosed
    DoEvents
    Loop
    Timer1.Interval = 8000
    Timer1.Enabled = True
End Sub


Private Sub Form_Load()
    Label1.Visible = False
    Picture1.AutoSize = False
    Picture1.Visible = False
    MSFlexGrid1.FixedCols = 0

    MSFlexGrid1.FormatString = "<文件名 |<停留时间|<显示方式|< 显示时间"
    MSFlexGrid1.ColWidth(0) = MSFlexGrid1.width * 0.35
    MSFlexGrid1.ColWidth(1) = MSFlexGrid1.width * 0.2
    MSFlexGrid1.ColWidth(2) = MSFlexGrid1.width * 0.2
    MSFlexGrid1.ColWidth(3) = MSFlexGrid1.width * 0.2
    读设置
End Sub

Sub ShowTextBox()
    With MSFlexGrid1

         '隐藏文本框,设置高度和宽度
         Text1.Visible = False
         Text1.height = .RowHeight(.Row) - (Screen.TwipsPerPixelY) * 2
         Text1.width = .ColWidth(.Col) - (Screen.TwipsPerPixelX) * 5
        ' 计算文本框左坐标
         Text1.Left = .CellLeft + .Left + (Screen.TwipsPerPixelX) * 3
         Text1.Top = .CellTop + .Top + (Screen.TwipsPerPixelY) * 1
         Text1.Visible = True
         Text1.SetFocus
    End With
End Sub


Private Sub MSFlexGrid1_KeyPress(KeyAscii As Integer)
    Dim char As String
    If KeyAscii = 13 Then
        Text1.Text = MSFlexGrid1.Text
        Text1.SelStart = Len(Text1.Text)
    Else
        char = Chr$(KeyAscii)
        Text1.Text = char
        Text1.SelStart = 1
    End If
        ShowTextBox
        KeyAscii = 0
End Sub
Private Sub MSFlexGrid1_LeaveCell()
    MSFlexGrid1.Text = Text1.Text
    If MSFlexGrid1.Col = 0 And MSFlexGrid1.Row <> 0 And _
     MSFlexGrid1.Row = MSFlexGrid1.Rows - 1 And MSFlexGrid1.Text <> "" Then
         MSFlexGrid1.Rows = MSFlexGrid1.Rows + 1
     End If
      
End Sub

Private Sub MSFlexGrid1_RowColChange()
     Text1.Text = MSFlexGrid1.Text
        ShowTextBox
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
        MSFlexGrid1.Text = Text1.Text
        Text1.Visible = False
        MSFlexGrid1.SetFocus
        
        If MSFlexGrid1.Col < (MSFlexGrid1.Cols - 1) Then
            MSFlexGrid1.Col = MSFlexGrid1.Col + 1
        ElseIf MSFlexGrid1.Row < MSFlexGrid1.Rows - 1 Then
            MSFlexGrid1.Row = MSFlexGrid1.Row + 1
            MSFlexGrid1.Col = 0
        End If
        KeyAscii = 0
    End If
End Sub


Private Sub Text2_Change()
ip_adr = Text2.Text
End Sub

Private Sub Timer1_Timer()
    Timer1.Interval = myshowmode(show_current \ 2).pausetime * 880
    If (show_current \ 2) * 2 <> show_current Then
        读数据
        
        OutString = "          奇瑞生产信息" & Chr(13) & Chr(10)
        OutString = OutString & Format(Date, "yyyy年mm月dd日 星期") & Choose(Weekday(Date), "日", "一", "二", "三", "四", "五", "六") & Format(Time, " hh:mm ") & Chr(13) & Chr(10)
        OutString = OutString & "年目标:" & njh & "辆 " & "年实际:" & nwc & " 辆" & Chr(13) & Chr(10)
        OutString = OutString & "月目标:" & yjh & "辆 " & "月实际:" & ywc & " 辆" & Chr(13) & Chr(10)
        OutString = OutString & "日目标:" & rjh & "辆 " & "日实际:" & rwc & " 辆" & Chr(13) & Chr(10)
        OutString = OutString & "节拍产量: " & jp & "秒/辆 " & Chr(13) & Chr(10)
        OutString = OutString & error_inf & Chr(14)
        Picture1.Visible = False
        Label1.Visible = True
        Label1.Caption = OutString
        OutString = "CHR" + Chr(2) + OutString
        string_s = True
        On Error Resume Next
        If tcpClient.State <> sckClosed Then _
        tcpClient.Close
        tcpClient.Connect ip_adr, PORT
        
        Close #2
    Else
        OutString = "PIC" + Chr(show_current \ 2 + 1) 'ping 1
        Picture1.Picture = LoadPicture(myshowmode(show_current \ 2).fileName)
        Picture1.Visible = True
        Label1.Visible = False
        string_s = True
        On Error Resume Next
        If tcpClient.State <> sckClosed Then _
        tcpClient.Close

⌨️ 快捷键说明

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