继承人我的潜意识:
Dim onThisTable as String ="Name"
Private Sub skill_mouseHover(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button1.MouseHover, button2.MouseHover, panel1.MouseHover, panel2.MouseHover, pbox1.MouseHover
descriptionLabel.Text = dbClass.getDescription(sender.Text, onThisTable)
End Sub
Run Code Online (Sandbox Code Playgroud)
现在我希望根据用户传递的内容(面板或pbox或按钮)给onThisTable一个不同的值,但我无法找到比较它是什么类型的正确方法...
Private Sub skill_mouseHover(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button1.MouseHover, button2.MouseHover, panel1.MouseHover, panel2.MouseHover, pbox1.MouseHover
if sender is ( a button )
onThisTable = "Admin"
else if sender is ( a panel )
onThisTable = "dbObject"
else
onThisTable ="Name"
end if
descriptionLabel.Text = dbClass.getDescription(sender.Text, onThisTable)
End Sub
Run Code Online (Sandbox Code Playgroud) 我有一个string.format问题......
我试图将我的发票ID作为参数传递给我的程序......第6个参数总是以" - "结束,无论我做什么(我们必须使用¿因为旧程序)...
public static void OpenIdInvoice(string wdlName, string IdInvoice, Form sender){
MessageBox.Show(string.Format("¿{0}",IdInvoice));
proc.Arguments = string.Format("{0}¿{1}¿{2}¿{3}¿{4}¿{5}",
session.SessionId.ToString(),
Session.GetCurrentDatabaseName(),
session.Librairie,
wdlName,
"",
IdInvoice
);
System.Windows.Forms.MessageBox.Show(proc.Arguments);
Run Code Online (Sandbox Code Playgroud)
最后," - "总是添加到我的格式化结果中,但仅在我的IdInvoice之前...(因此Id 10在我的参数中最终为-10)
现在有趣的部分...我硬编码一些字符串和......
如果我传递-1而不是Id,我有--1作为结果如果我写"香蕉"...我得到"-banana"...
我知道我可以建立字符串,否则......但我很好奇它为什么会发生.
编辑:
这就是我的代码的复制/粘贴
var proc = new System.Diagnostics.ProcessStartInfo("Achat.exe");
System.Windows.Forms.MessageBox.Show(string.Format("¿{0}",args));
proc.Arguments = string.Format(@"{0}¿{1}¿{2}¿{3}¿{4}¿{5}¿{6}",
"12346", //session.SessionId.ToString(),
"fake DB",//Session.GetCurrentDatabaseName().ToString(),
"false", //session.Librairie.ToString(),
"myScreenName", //wdl.ToString(),
"123456",
"Banana",
"123456"
//args.ToString(),
);
System.Windows.Forms.MessageBox.Show(proc.Arguments);
System.Windows.Forms.MessageBox.Show(args);
Run Code Online (Sandbox Code Playgroud)
那就是我的文本可视化结果的复制/粘贴:
12346¿fakeDB¿false¿myScreenName¿123456¿Banana¿123456