0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

我的第一个计算器

Posted at

我的第一个计算器

image.png

image.png
a TextInput_a
計算 Dropdown_operator +-*/
b TextInput_b

糙版
image.png
結果
If(
Dropdown_operator.Selected.Value = "+",
TextInput_a + TextInput_b,
Dropdown_operator.Selected.Value = "-",
TextInput_a - TextInput_b,
Dropdown_operator.Selected.Value = "*",
TextInput_a * TextInput_b,
TextInput_a / TextInput_b
)

优雅版
image.png
結果 Switch(
Dropdown_operator.Selected.Value,
"+",
TextInput_a.Text + TextInput_b.Text,
"-",
TextInput_a.Text - TextInput_b.Text,
"*",
TextInput_a.Text * TextInput_b.Text,
TextInput_a.Text / TextInput_b.Text
)

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?