Foxtable(狐表)用户栏目专家坐堂 → [求助]我怎样才能让他不执行清空啊。气死了


  共有3412人关注过本帖树形打印复制链接

主题:[求助]我怎样才能让他不执行清空啊。气死了

帅哥哟,离线,有人找我吗?
zto001
  11楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:六尾狐 帖子:1465 积分:10397 威望:0 精华:0 注册:2018/10/16 11:42:00
  发帖心情 Post By:2021/3/4 17:32:00 [显示全部帖子]

我就是导出窗口搞的,新项目能执行。见鬼,原项目整个表的代码都注释的差不多了,还是这样的情况。。如果是手输就不会出现这样的情况(极慢的速度扫描上传上去的好像也行,跟手输一样的速度)。扫描就是正常的。

 回到顶部
帅哥哟,离线,有人找我吗?
zto001
  12楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:六尾狐 帖子:1465 积分:10397 威望:0 精华:0 注册:2018/10/16 11:42:00
  发帖心情 Post By:2021/3/4 17:35:00 [显示全部帖子]

扫描又出现一种情况。扫描后继承了前一次手输的字符串。就跟没扫描数字一样只有回车一样。但是扫描后明显可以看到有很快录入扫的单号,然后这个扫的单号没有,只有手录的

 回到顶部
帅哥哟,离线,有人找我吗?
zto001
  13楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:六尾狐 帖子:1465 积分:10397 威望:0 精华:0 注册:2018/10/16 11:42:00
  发帖心情 Post By:2021/3/4 17:36:00 [显示全部帖子]

这是窗口,窗口类型是主窗口
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:0.zip


 回到顶部
帅哥哟,离线,有人找我吗?
zto001
  14楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:六尾狐 帖子:1465 积分:10397 威望:0 精华:0 注册:2018/10/16 11:42:00
  发帖心情 Post By:2021/3/4 17:45:00 [显示全部帖子]

所有窗口表格除了临时表跟在用的这个窗口,其他全删了,还是一样。还有哪里能删不?

 回到顶部
帅哥哟,离线,有人找我吗?
zto001
  15楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:六尾狐 帖子:1465 积分:10397 威望:0 精华:0 注册:2018/10/16 11:42:00
  发帖心情 Post By:2021/3/4 17:52:00 [显示全部帖子]

以下是全局代码。帮忙看下是不是这里面某个的原因

全局代码1
Public 中通 As Image = GetImage("中通.png")
Public _IP地址 As String
Public _数据源 As String
Public _表名称 As String
Public _快递行 As Row
Public _快递临时表 As DataTable
Public _店铺临时表 As DataTable
Public _货主 As String
Public _账户 As String
Public _货主ID As String
Public _账户ID As String
Public _货主权限 As String

全局代码2
Public Class MsgBox
Private Sub MessageBox_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.Timer1.Interval = 30000 '设置执行间隔(30秒)
End Sub

Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Me.Close() '计时器自动关闭提示窗口
End Sub
End Class

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class MsgBox
Inherits System.Windows.Forms.Form

'Form 重写 Dispose,以清理组件列表.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
    If disposing AndAlso components IsNot Nothing Then
        components.Dispose()
    End If
Finally
    MyBase.Dispose(disposing)
End Try
End Sub

'Windows 窗体设计器所必需的
Private components As System.ComponentModel.IContainer

'注意: 以下过程是 Windows 窗体设计器所必需的
'可以使用 Windows 窗体设计器修改它.
'不要使用代码编辑器修改它.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Me.TextBox1 = New System.Windows.Forms.TextBox()
Me.Timer1 = New System.Windows.Forms.Timer(Me.components)
Me.SuspendLayout()
'
'TextBox1
'
Me.TextBox1.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.TextBox1.Location = New System.Drawing.Point(13, 13)
Me.TextBox1.Multiline = True
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.ReadOnly = True
Me.TextBox1.Size = New System.Drawing.Size(259, 138)
Me.TextBox1.TabIndex = 1
Me.TextBox1.TabStop = False
'
'Timer1
'
'
'MsgBox
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 12.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(284, 161)
Me.Controls.Add(Me.TextBox1)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow
Me.Name = "MsgBox"
Me.ShowIcon = False
Me.Text = "提示"
Me.ResumeLayout(False)
Me.PerformLayout()

End Sub
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
Friend WithEvents Timer1 As System.Windows.Forms.Timer
End Class

全局代码3
Public Class MyForm
#Region "提示框"
Shared Sub MsgBox(ByVal Text As String, Optional ByVal title As String = Nothing, Optional ByVal sj As Boolean = False)

Dim Frm As New MsgBox
Frm.Text = iif(title Is Nothing,Frm.Text,title) '设置窗口标题
Frm.TextBox1.Text = Text '设置窗口文本内容
Dim Width As Integer = System.Windows.Forms.SystemInformation.WorkingArea.Width '获取屏幕的宽度
Dim Height As Integer = System.Windows.Forms.SystemInformation.WorkingArea.Height '获取屏幕的高度
If IO.File.Exists(ProjectPath & "Images\Logo.ico") = True Then '如果找到该文件的话
    Dim ico As New Icon(ProjectPath & "Images\Logo.ico", 16, 16) '设置窗口的图标
    Frm.Icon = ico
End If
Frm.StartPosition = System.Windows.Forms.FormStartPosition.Manual
Dim StartPoint As New System.Drawing.Point
StartPoint.X = Width - Frm.Width
StartPoint.Y = Height - 10
Frm.Location = StartPoint
Frm.Show()
If IO.File.Exists(ProjectPath & "Wav\MsgBox.wav") = True Then '如果找到音频文件的话,播放该文件
    My.Computer.Audio.Play(ProjectPath & "Wav\MsgBox.wav")
End If
For i As Integer = 1 To Frm.Height Step 2
    Frm.SetBounds(Width - Frm.Width, Height - i, Frm.Width, Frm.Height)
Next
If sj = True Then
    Frm.Timer1.Enabled = True
    End If
End Sub
#End Region
End Class



 回到顶部
帅哥哟,离线,有人找我吗?
zto001
  16楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:六尾狐 帖子:1465 积分:10397 威望:0 精华:0 注册:2018/10/16 11:42:00
  发帖心情 Post By:2021/3/4 17:53:00 [显示全部帖子]


全局代码4

Public Sub BeautifyControls(ByVal e As WinForm.Form,ByVal _Values As String)
Dim Values() As String = _Values.Split(",")
For Index As Integer = 0 To Values.Length - 1
    Dim BeautifyControl As New BeautifyControl(e.Controls(Values(Index)))
Next

End Sub


Public Class BeautifyControl
    Private Control As WinForm.Control
    Private Label As WinForm.Label
    Public Sub New(ByVal _Control As WinForm.Control)

        Dim lbl As WinForm.Label
        lbl = _Control.Form.CreateControl("lable1", ControlTypeEnum.Label)
        lbl.Name = "lable-" & _Control.Name
        lbl.BackColor = Color.Transparent
        lbl.TextAlign = ContentAlignment.MiddleLeft
        _Control.Parent.AddControl(lbl)
        lbl.AutoSize = False
        lbl.SetBounds(_Control.Left, _Control.Top, _Control.Width, _Control.Height)
        lbl.Anchor = _Control.Anchor
        lbl.Dock = _Control.Dock


        Me.Control = _Control
        Me.Label = lbl
        Me.Control.Visible = False

        Dim ln As WinForm.Line = _Control.Form.CreateControl("lable1", ControlTypeEnum.Line)
        ln.Anchor = _Control.Anchor
        _Control.Parent.AddControl(ln)
        ln.Left = _Control.Left
        ln.Top = _Control.Top + _Control.Height - 16
        ln.Width = _Control.Width

        AddHandler lbl.BaseControl.Click, AddressOf Label_Click
        AddHandler lbl.BaseControl.VisibleChanged, AddressOf Label_VisibleChanged
        AddHandler Me.Control.BaseControl.Leave, AddressOf Control_Leave
    End Sub

    Private Sub Label_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Me.Control.Visible = True
        Me.Control.Select()
        Me.Control.Form.Controls(Control.Name).BaseControl.SelectionLength = 0
        Me.Label.Visible = False
    End Sub

    Private Sub Label_VisibleChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
        If Me.Label.Visible = True Then
            If Me.Control.Form.ExistControl(Control.Name) Then
                If Me.Control.BindingField = Nothing Then
                    Me.Label.Text = Me.Control.Form.Controls(Control.Name).Value
                Else
                    Me.Label.BindingField = Me.Control.BindingField
                End If
                Me.Label.ForeColor = Me.Control.ForeColor
            End If
        End If
    End Sub
    '当文本控件不是活动控件的时候发生
    Private Sub Control_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Me.Label.Visible = True
        Me.Control.Visible = False
    End Sub
End Class



 回到顶部
帅哥哟,离线,有人找我吗?
zto001
  17楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:六尾狐 帖子:1465 积分:10397 威望:0 精华:0 注册:2018/10/16 11:42:00
  发帖心情 Post By:2021/3/4 17:53:00 [显示全部帖子]

全局代码5
'【】消除边框
Public myform1 As System.Windows.Forms.Form

Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As IntPtr, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Boolean
Public Declare Function ReleaseCapture Lib "user32" () As Integer

Public Const BorderWidth As Integer = 6
Public _resizeDir As ResizeDirection = ResizeDirection.None

Public Enum ResizeDirection
None = 0
Left = 1
TopLeft = 2
Top = 3
TopRight = 4
Right = 5
BottomRight = 6
Bottom = 7
BottomLeft = 8
End Enum


Public Property resizeDir() As ResizeDirection
Get
Return _resizeDir
End Get
Set(ByVal value As ResizeDirection)
_resizeDir = value

'Change cursor
Select Case value
    Case ResizeDirection.Left
        myform1.Cursor = System.Windows.Forms.Cursors.SizeWE
        
    Case ResizeDirection.Right
        myform1.Cursor = System.Windows.Forms.Cursors.SizeWE
        
    Case ResizeDirection.Top
        myform1.Cursor = System.Windows.Forms.Cursors.SizeNS
        
    Case ResizeDirection.Bottom
        myform1.Cursor = System.Windows.Forms.Cursors.SizeNS
        
    Case ResizeDirection.BottomLeft
        myform1.Cursor = System.Windows.Forms.Cursors.SizeNESW
        
    Case ResizeDirection.TopRight
        myform1.Cursor = System.Windows.Forms.Cursors.SizeNESW
        
    Case ResizeDirection.BottomRight
        myform1.Cursor = System.Windows.Forms.Cursors.SizeNWSE
        
    Case ResizeDirection.TopLeft
        myform1.Cursor = System.Windows.Forms.Cursors.SizeNWSE
        
    Case Else
        myform1.Cursor = System.Windows.Forms.Cursors.Default
End Select
End Set
End Property

Public Const WM_NCLBUTTONDOWN As Integer = &HA1
Public Const HTBORDER As Integer = 18
Public Const HTBOTTOM As Integer = 15
Public Const HTBOTTOMLEFT As Integer = 16
Public Const HTBOTTOMRIGHT As Integer = 17
Public Const HTCAPTION As Integer = 2
Public Const HTLEFT As Integer = 10
Public Const HTRIGHT As Integer = 11
Public Const HTTOP As Integer = 12
Public Const HTTOPLEFT As Integer = 13
Public Const HTTOPRIGHT As Integer = 14


Public Sub MoveForm()
ReleaseCapture()
SendMessage(myform1.Handle, WM_NCLBUTTONDOWN, HTCAPTION, 0)
End Sub

Public Sub ResizeForm(ByVal direction As ResizeDirection)
Dim dir As Integer = -1
Select Case direction
    Case ResizeDirection.Left
        dir = HTLEFT
    Case ResizeDirection.TopLeft
        dir = HTTOPLEFT
    Case ResizeDirection.Top
        dir = HTTOP
    Case ResizeDirection.TopRight
        dir = HTTOPRIGHT
    Case ResizeDirection.Right
        dir = HTRIGHT
    Case ResizeDirection.BottomRight
        dir = HTBOTTOMRIGHT
    Case ResizeDirection.Bottom
        dir = HTBOTTOM
    Case ResizeDirection.BottomLeft
        dir = HTBOTTOMLEFT
End Select

If dir <> -1 Then
    ReleaseCapture()
    SendMessage(myform1.Handle, WM_NCLBUTTONDOWN, dir, 0)
End If
End Sub


Public Sub myform1_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) 
If e.Button = System.Windows.Forms.MouseButtons.Left And myform1.WindowState <> System.Windows.Forms.FormWindowState.Maximized Then
    ResizeForm(resizeDir)
End If
End Sub

Public Sub myform1_MouseMove(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) 
'Calculate which direction to resize based on mouse position

If e.Location.X < BorderWidth And e.Location.Y < BorderWidth Then
    resizeDir = ResizeDirection.TopLeft
    
ElseIf e.Location.X < BorderWidth And e.Location.Y > myform1.Height - BorderWidth Then
    resizeDir = ResizeDirection.BottomLeft
    
ElseIf e.Location.X > myform1.Width - BorderWidth And e.Location.Y > myform1.Height - BorderWidth Then
    resizeDir = ResizeDirection.BottomRight
    
ElseIf e.Location.X > myform1.Width - BorderWidth And e.Location.Y < BorderWidth Then
    resizeDir = ResizeDirection.TopRight
    
ElseIf e.Location.X < BorderWidth Then
    resizeDir = ResizeDirection.Left
    
ElseIf e.Location.X > myform1.Width - BorderWidth Then
    resizeDir = ResizeDirection.Right
    
ElseIf e.Location.Y < BorderWidth Then
    resizeDir = ResizeDirection.Top
    
ElseIf e.Location.Y > myform1.Height - BorderWidth Then
    resizeDir = ResizeDirection.Bottom
    
Else
    resizeDir = ResizeDirection.None
End If
End Sub

全局代码6
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As IntPtr, ByVal wMsg As Integer, ByVal wParam As IntPtr, ByVal lParam As Byte()) As Integer
Public Const EM_SETCUEBANNER As Integer = &H1501
Public Sub SetWatermark(wTextBox As winform.textbox,str As String)
SendMessage(wTextBox.BaseControl.Handle, EM_SETCUEBANNER, IntPtr.Zero, System.Text.Encoding.Unicode.GetBytes(str))
End Sub

 回到顶部
总数 18 上一页 1 2