Skip to content
Back to skills

Vb Net Multi Instance Form Management With Button State Control

ASecurity

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.

  • 438 stars
  • 0 votes
  • 0 copies
  • 6 views
  • Added May 30, 2026
education

Works with

  • cli

Security analysis

A100/100

Scanned May 30, 2026

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

Installs into .claude/skills of the current project.

Are you the author of Vb Net Multi Instance Form Management With Button State Control?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Vb Net Multi Instance Form Management With Button State Control
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-vb-net-multi-instance-form-management-with-button-/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-vb-net-multi-instance-form-management-with-button-)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "7f15b48e-0157-42cf-84c8-17b1a5310329"
name: "VB.NET Multi-Instance Form Management with Button State Control"
description: "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."
version: "0.1.0"
tags:
  - "vb.net"
  - "winforms"
  - "form-management"
  - "button-state"
  - "event-handling"
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"
---

# 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

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…