我想在文本框中显示 C 代码,这样当您单击按钮时,代码将出现在文本框中,我的问题是 VB.net 将文本理解为代码
我正在为按钮使用此代码行
textbox2.Text = "
#include <LiquidCrystal.h>
//Set's lcd to the Arduino's ports
LiquidCrystal lcd(12, 11, 10, 9, 8, 7);
void setup() {
lcd.begin(16, 2);
Serial.begin(9600);
}
void loop() {
"
如何让 vb.net 忽略“”之间的 C 代码
你将不得不做这样的事情。
RichTextBox1.Text = "#include <LiquidCrystal.h>" & vbCrLf & _
"//Set's lcd to the Arduino's ports" & vbCrLf & _
"LiquidCrystal lcd(12, 11, 10, 9, 8, 7);" & vbCrLf & _
"void setup() {" & vbCrLf & _
" lcd.begin(16, 2);" & vbCrLf & _
"Serial.begin(9600);" & vbCrLf & _
"}" & vbCrLf & _
"void loop() {"
vbCrLf
是一个回车,所以它会从下一行开始。