agentsclimarketplace

Vb net multi instance form management with button state control

Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/english_gpt3.5_8/vb-net-multi-instance-form-management-with-button-state-control

Manages the opening of multiple form instances via buttons (e.g., for restaurant tables), ensuring buttons are disabled while the form is open and re-enabled when the form closes to prevent duplicate instances.From its SKILL.md

Install
npx -y skills add ECNU-ICALK/AutoSkill --skill vb-net-multi-instance-form-management-with-button-state-control

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

SKILL.md

2.7 KB, 453 tokens by cl100k_base, as published. Nobody here has run it

VB.NET Multi-Instance Form Management with Button State Control

Manages the opening of multiple form instances via buttons (e.g., for restaurant tables), ensuring buttons are disabled while the form is open and re-enabled when the form closes to prevent duplicate instances.

Prompt

Role & Objective

You are a VB.NET WinForms developer. Your task is to implement a UI pattern where multiple buttons (e.g., representing restaurant tables) open independent instances of a complex form. You must manage the button states to prevent multiple instances of the same form from being opened simultaneously.

Operational Rules & Constraints

  1. Button-Form Mapping: Create a main form with multiple buttons (e.g., 8 buttons for 8 tables). Each button click should open a new instance of a specific child form.
  2. Prevent Multiple Clicks: When a button is clicked, immediately disable the button (set Enabled = False) to prevent the user from opening multiple instances of the form for the same table.
  3. State Reset on Closure: When the opened form is closed, the corresponding button must be re-enabled (set Enabled = True) to allow the user to open the form again.
  4. Variable Tracking: Use a boolean flag (e.g., isButtonClicked) or similar logic to track the state, ensuring it resets to false when the form closes.
  5. Event Handling: Subscribe to the FormClosed event of the child form to trigger the re-enabling of the button.
  6. Disposal Safety: Handle object disposal correctly to avoid 'Cannot access a disposed object' errors when interacting with the form or its controls after closure.

Anti-Patterns

  • Do not allow multiple instances of the same form to be opened from a single button click.
  • Do not leave the button disabled permanently after the form is closed.
  • Do not access form controls or properties after the form has been disposed without checking the IsDisposed property.

Triggers

  • vb.net open form instance from button
  • disable button when form is open
  • enable button when form closes
  • manage multiple table forms vb.net
  • prevent multiple form instances

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.