Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › Visual Basic Programming › [TuT]Preventing your Program from Closing

[TuT]Preventing your Program from Closing

Posts 1–5 of 5 · Page 1 of 1
IA
Iamazn
[TuT]Preventing your Program from Closing
Add this code to your form.
Code:
    Private Sub Form1Closing(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
        e.Cancel = True
    End Sub
If you want to be able to exit, add this code to a button
Code:
End
It should look something like this, IF your button is called Button1 and your form is called Form1
Code:
Public Class Form1

    Private Sub Form1Closing(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
        e.Cancel = True
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        End
    End Sub
End Class
#1 · 17y ago
Zoom
Zoom
Fail..... e.cancel = true is not right...Give a error!

Put: eventArgs.Cancel = True and then it will work...

Thank me if I helped!
#2 · 17y ago
IA
Iamazn
Quote Originally Posted by hejsan1 View Post
Fail..... e.cancel = true is not right...Give a error!

Put: eventArgs.Cancel = True and then it will work...

Thank me if I helped!
You need to have
Code:
 Private Sub Form1Closing(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
#3 · 17y ago
Zoom
Zoom
huh.... I´m know that....
#4 · 17y ago
IA
Iamazn
Quote Originally Posted by hejsan1 View Post
huh.... I´m know that....
If you knew that how come you said it gave an error?
#5 · 17y ago
Posts 1–5 of 5 · Page 1 of 1

Post a Reply

Similar Threads

  • Prevent Your work from getting Leeched!By Invidus in Combat Arms Discussions
    13Last post 16y ago
  • [TUT]Change your IP!By xxpagxx in WarRock - International Hacks
    44Last post 19y ago
  • (TUT) Make your hack less detected. (NEW)By JuniorD in WarRock - International Hacks
    3Last post 18y ago
  • [TuT] Make Your Own Clean.BatBy Recreation in WarRock - International Hacks
    4Last post 18y ago
  • [TUT]Spoof your name including GM RankBy Mat901 in Combat Arms Hacks & Cheats
    11Last post 18y ago

Tags for this Thread

#closing#program#tutpreventing