VB高手来下啊,
答案:2 悬赏:0 手机版
解决时间 2021-08-15 13:40
- 提问者网友:趣果有间
- 2021-08-14 22:01
Dim r As Long
FindWindow(vbNullString, "迅雷")
ShowWindow r, SW_HIDE
Form1.Show
我想把上面的改成一个if判断语句,判断当有迅雷的时候则程序自动隐藏迅雷,我放在timer控件里面的,每500毫秒执行一次、隐藏过后再执行下面的form1如果没有迅雷窗口就不要调用form1 ,可是我翻来覆去都不知道怎么弄哦,一运行他就直接调用form1了
下面是我想的一段代码你们就完全懂我意思了哈
Dim r As Long
If FindWindow(vbNullString, "迅雷") = r Then
ShowWindow r, SW_HIDE
Form1.Show
Else
end if
最佳答案
- 五星知识达人网友:佘樂
- 2021-08-14 23:26
两点,首先迅雷是否没关闭,第二就是不用的时候你应该ELSE FORM1.hide
全部回答
- 1楼网友:神也偏爱
- 2021-08-14 23:44
Option ExplicitDim cnn As New ADODB.Connection'Dim fileName As StringPrivate Sub Command1_Click()'将文本框中的信息添加到列表框中Dim i As IntegerDim rs As New ADODB.RecordsetDim sql As Stringsql = "select 姓名,地址,邮编,电话 from 通讯录表 where 姓名='" & Text1(0).Text & "'"rs.Open sql, cnn, adOpenKeyset, adLockOptimisticIf rs.EOF Then rs.AddNewWith ListView1.ListItems.Add().Text = Text1(0)rs(0) = Text1(0).TextFor i = 1 To 3.SubItems(i) = Text1(i).Textrs(i).Value = Text1(i).TextNext iEnd Withrs.Updaters.CloseEnd SubPrivate Sub Command2_Click()'删除列表框中信息If ListView1.ListItems.Count > 0 Then If MsgBox("真的要删除吗?", vbQuestion + vbYesNo + vbDefaultButton2) = vbYes Then cnn.Execute "delete 通讯录表 where 姓名 = '" & ListView1.SelectedItem.Text & "'" ListView1.ListItems.Remove ListView1.SelectedItem.Index End IfEnd IfEnd SubPrivate Sub Form_Load()Dim tpStr As String, i As Integer, j As IntegerMe.Caption = "通讯录"For j = 0 To 3Text1(j).Text = ""Next j'fileName = App.Path & "\data.txt"'If Dir(fileName) <> "" Then'加载数据Dim connString As String'如果是sql服务器connString = "Data Source=服务器IP;Initial Catalog=数据库名;Provider=SQLOLEDB.1;User ID=sa;Password=密码"'如果是ACCESSconnString = "Provider = Microsoft.Jet.OLEDB.4.0;Data Source = D:\data\data.mdb"cnn.Open connString Dim rs As New ADODB.Recordsetrs.Open "select 姓名,地址,邮编,电话 from 通讯录表", cnnDo Until rs.EOF With ListView1.ListItems.Add() .Text = rs(0).Value & "" For i = 0 To 3 .SubItems(i) = rs(i).Value & "" Next i End With rs.MoveNextLooprs.CloseEnd SubPrivate Sub Form_Unload(Cancel As Integer)cnn.CloseEnd Sub
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯