【问题标题】:HOW to solve "Compile error: Type mismatch" with own file ocx in VB6如何在 VB6 中使用自己的文件 ocx 解决“编译错误:类型不匹配”
【发布时间】:2021-07-22 00:34:44
【问题描述】:

我有一个名为 GridEntry.ocx 的 ActiveX,我是从下载链接 GridEntry.ocx 中找到的

我想用它来做一个软件。 但我遇到了麻烦,并收到一条错误消息。 “编译错误:类型不匹配” 我的代码

Private Sub GridEntry1_KeyPress(KeyAscii As Integer, Row As Integer, Col As Byte)
If KeyAscii = 13 Then
Post = GridEntry1.CellFocus(0, 1)
 With GridEntry1
  .Caption = "TEST"
  End With
End If
End Sub

【问题讨论】:

  • 您在哪一行看到错误?
  • 在这行Post = GridEntry1.CellFocus(0, 1)

标签: vb6 activex ocx


【解决方案1】:

使用这个

Private Sub GridEntry1_KeyPress(KeyAscii As Integer, Row As Integer, Col As Byte)
If KeyAscii = 13 Then
Call  GridEntry1.CellFocus(0, 1)
 With GridEntry1
  .Caption = "TEST"
  End With
End If
End Sub

【讨论】:

  • 哇,太好了,您的解决方案运行良好。非常感谢您的帮助???
  • 嗨,沃尔坎,感谢您的回答。你能解释一下为什么你的解决方案有效吗? (PostCall 是什么?)
  • “调用”只执行函数或子
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2021-05-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多