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 › [HELP] Two Ifs[Solved]

[HELP] Two Ifs[Solved]

Posts 1–15 of 20 · Page 1 of 2
tempta43
tempta43
[HELP] Two Ifs[Solved]
Is there any way to do this sort of thing?

Code:
If TextBox2.Text = "test" & TextBox1.Text = "test" Then
MsgBox("Test")
        Else
MsgBox("Fail")
End If
Thanks.
#1 · 16y ago
Lolland
Lolland
Code:
If TextBox2.Text = "test" and TextBox1.Text = "test" Then
MsgBox("Test")
        Else
MsgBox("Fail")
End If
#2 · 16y ago
NextGen1
NextGen1
Ha , So Close

[php]
If TextBox2.Text = "test" And TextBox1.Text = "test" Then
MsgBox("Test")
Else
MsgBox("Fail")
End If
[/php]

And not &

and grrrrrrrr lolland by one second, really

#3 · 16y ago
mnpeepno2
mnpeepno2
Beat you nextgen, mine is shorter
[php]
If TextBox2.Text = "test" = TextBox1.Text Then
MsgBox("Test")
Else
MsgBox("Fail")
End If
[/php]
#4 · 16y ago
flameswor10
flameswor10
I do
Code:
If Textbox1.text = "test" Then
    If Textbox2.text = "test" Then
Msgbox("Test")
Else
Msgbox("Failed")
End if
End If
#5 · edited 16y ago · 16y ago
Lolland
Lolland
That's inefficient though

And mnpeep your only works if the textbox text has to be the same.
#6 · 16y ago
Jason
Jason
Quote Originally Posted by flameswor10 View Post
I do
Code:
If Textbox1.text = "test" Then
    If Textbox2.text = "test" Then
Msgbox("Test")
Else
Msgbox("Failed")
End if
I only use this if I need error specific message boxes, i.e

[php]

If TxtUsername.Length > 0 Then
if TxtPassword.Length > 0 then
'do Login'
else
msgbox("Please enter a password first!", vbExclamation, "Error: No Password")
end if
else
msgbox("Please enter a username!", vbExclamation, "Error: No Username")
end if

[/php]

But for situations where you don't need a specific "else", this is sorta inefficient + confusing as hell to follow later on when you don't remember exactly what it was supposed to do
#7 · 16y ago
flameswor10
flameswor10
Whoops i forgot an endif LOL
#8 · 16y ago
'Bruno
'Bruno
you don't have an idea how annoying it is for me to read code not correctly indented.

Code:
If Textbox1.text = "test" Then
    If Textbox2.text = "test" Then
         Msgbox("Test")
    Else
         Msgbox("Failed")
    End if
End If
like this you would not forget that endif im pretty sure X:
#9 · edited 16y ago · 16y ago
Jason
Jason
Quote Originally Posted by Brinuz View Post
you don't have an idea how annoying it is for me to read code not correctly indented.

Code:
If Textbox1.text = "test" Then
    If Textbox2.text = "test" Then
         Msgbox("Test")
    Else
         Msgbox("Failed")
    End if
End If
like this you would not forget that endif im pretty sure X:
Although I completely agree that it's a lot easier to read properly indented code, it is quite annoying trying to indent it on a forum where "Tab" doesn't do indenting, hitting space to indent is annoying. So either you have to open VB and type out the snippet and then C+P it back in, or do what i do and do space indenting which is annoying as hell on a long snippet.
#10 · 16y ago
Hassan
Hassan
Quote Originally Posted by mnpeepno2 View Post
Beat you nextgen, mine is shorter
[php]
If TextBox2.Text = "test" = TextBox1.Text Then
MsgBox("Test")
Else
MsgBox("Fail")
End If
[/php]
Fail ... Conversion from "test" to boolean failed !!! LOL

Code:
MsgBox(If(Not TextBox1.Text = "test" And TextBox2.Text = "test", "Fail", "Test"))
I Won
#11 · 16y ago
NextGen1
NextGen1
I won too.

Boolean. Ha Ha/
#12 · 16y ago
QD
qddW$#%^jtyjtyj
Lol ask for that question /
#13 · 16y ago
mnpeepno2
mnpeepno2
im still a winner in my heart

MsgBox(If(both TextBox1.Text And TextBox2.Text = "test", "Fail", "Test"))
suck that
#14 · edited 16y ago · 16y ago
SK
skiiiz
In this case I reckon NEXTGENS code is more appropriate for the question. As for mnpeep he wants the password to be test. The user can make the password on both boxes "abc" and it will accept in.
#15 · 16y ago
Posts 1–15 of 20 · Page 1 of 2

Post a Reply

Similar Threads

  • [HELP] 2 ifs in 1 if. [Solved]By Acinonyx Backup in Visual Basic Programming
    12Last post 15y ago
  • Help me to solve this ? :#By josias008 in Combat Arms Help
    9Last post 15y ago
  • [Help]Custom GUI[Solved]By martijno0o0 in Visual Basic Programming
    1Last post 16y ago
  • [Help] Missing Tabs [Solved]By zmansquared in Visual Basic Programming
    18Last post 16y ago
  • [Help]Sleep/Pause[Solved]By jakobkorber in Visual Basic Programming
    11Last post 16y ago

Tags for this Thread

None