Numupdown框的进度条问题问题

发布于 2025-02-08 12:32:53 字数 416 浏览 2 评论 0原文

我试图将进度栏作为DND的生命跟踪器。我正在使用NumericUpdown框来控制生命条,因为一个框是HP,第二个是HP Max,而另一个是用于HP的更改。

我在HP NemericUpdown up Clicker上遇到麻烦,将HP添加到进度栏中,并且在调试中崩溃了。谁能帮忙?

代码:

  • HP是HP数字上升,
  • 健康IS Progress Bar
  • Max Max Max HP数字向下
private void HP_MouseUp(object sender, MouseEventArgs e)
{
    if (HP.Value > Health.Maximum) ;
    Health.Maximum = (int)Max.Value;
 

I am trying to use a progress bar as a life tracker for DND. I am using NumericUPDown boxes to control the life bar as one box is HP, a second is HP Max and the other is for the changes in HP.

I am having trouble with the HP NumericUpDown up clicker adding the Hp to be more than the Progress bar and it crashes the progream in debug. Can anyone help?

Code:

  • HP is HP Numeric Up Down
  • Health is Progress bar
  • Max is Max HP Numeric Up Down
private void HP_MouseUp(object sender, MouseEventArgs e)
{
    if (HP.Value > Health.Maximum) ;
    Health.Maximum = (int)Max.Value;
 

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夏の忆 2025-02-15 12:32:53

我过度复杂化了。
我试图用数字来进行数学工作。

没有想到将我的最大值作为我想要停止的数字的想法。

            {
                HPNum.Maximum = MaxHPNUM.Value;

            }
        

I was overcomplicating it....
I was trying to do maths with the NumberUpDown stuff.

Didn't think for ages about just setting my maximum to be what I wanted the number to stop at.

            {
                HPNum.Maximum = MaxHPNUM.Value;

            }
        
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文