是德科技
直播中

汪海源

7年用户 222经验值
私信 关注
[问答]

重复的表单问题

嗨,我需要帮助。
我有一个主窗体,在单击按钮时会打开其他窗体。
问题是当另一个表单打开时,它会在第二次单击按钮后再次打开。
因此,它将使重复的表单出现在桌面上。
当我第一次点击按钮打开表单时,我现在想要的是什么。
如果表单已经出现在桌面上,它只会弹出并最大化表单。
在主窗体中现在只有一个按钮并执行程序对象。
我不知道如何实现它。
任何人有任何想法,我需要什么样的对象来解决这个问题?

以上来自于谷歌翻译


     以下为原文

  hi,

I need help. I have a main form that will open other form when clicking the button. The problem is when the other form was opened, it will open again after second time clicking the button. So it will make duplicate form appear on the desktop. What i want now when buttons is click for the first time it will open the form. If the form is already appear on the desktop, it just pop up and maximize the form. In a main form now only have a button and execute program object. I do not know how to implement it. Anyone have any idea and what kind of object that i need to solve this problem?  

回帖(1)

喻唯

2019-3-25 10:13:37
嗯,我以前从来没有真正做到过,但是这就是我接近它的方法。初始化变量以检查按钮的statusPut是一个If-Then语句/块,然后执行Click of按钮检查按钮之前是否已被点击,
如果它之前检查然后最大化窗口,如果没有,打开它。然后单击该按钮后,在您用于If-Then语句的变量中放置一个值。希望这有帮助。

以上来自于谷歌翻译


     以下为原文

  Hmmm, I never actually did it before, but here's how I would approach it.

Initialize a variable to check the button's status

Put an If-Then statement/block before execute the Click of button to check if the button was previously clicked already or not, if it checked before then maximize the window, if not, open it up.

And after you clicked the button, place a value in the variable that you use for the If-Then statement.


Hope this helps.
举报

更多回帖

发帖
×
20
完善资料,
赚取积分