VB 如何向一个对话框发送确认命令?

来源:百度知道 编辑:UC知道 时间:2024/05/28 07:23:34
如: 删除文件时出现<确认文件删除>对话框, VB如何向这个对话框发送确认的命令? 求代码.
我要补充一下了, 是平时在系统中删除文件Windows系统本身弹出的<确认文件删除>对话框,不是VB程序要弹出对话框; VB程序如何去找到这个对话框并向这个对话框发送确认信息?

我知道C# VB现在都没人用了,VB淘汰了

namespace WindowsApplication3
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{
DialogResult result=MessageBox.Show("as","a",MessageBoxButtons.YesNo,MessageBoxIcon.Information);
if (result = DialogResult.Yes)
{
//语句块
}
}
}
}

Dim x
x = MsgBox("确定要删除文件吗", vbYesNo, "删除文件确认")
If x = vbYes Then
删除文件
Else
exit sub
End If

Dim x
x = MsgBox("确定要删除文件吗", vbYesNo, "删除文件确认")
If x = vbYes Then
删除文件
Else
exit sub
End If

-------- > 不是VB自身要弹出对话框,而是平时系统要删除文件时弹出的对话框,VB程序去确认这个对话框;

sendkey{……} --- >