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]ElseIf, EndIf. If[Closed]

Question[Help]ElseIf, EndIf. If[Closed]

Posts 1–15 of 16 · Page 1 of 2
PP
ppl2pass
[Help]ElseIf, EndIf. If[Closed]
I need help for the code highlighted in red.
So if a "combbox7.text = combbox8.text"
then
"combbox7.text = red and combbox8.text = red"

but

when they are different meaning when combbox7.text does not equal combbox8.text

return to original colour `black`
so combbox7.text = black
and combbox8.text = black.

but that doesnt work. the code to turn the text back to black.

Heres the code:
Code:
            If ComboBox7.Text = ComboBox8.Text Or ComboBox7.Text = ComboBox9.Text Or ComboBox8.Text = ComboBox9.Text Then
            MessageBox.Show("You have two or more of the same perk.", "Error!", MessageBoxButtons.OK, MessageBoxIcon******rmation)
            If ComboBox7.Text = ComboBox8.Text Then
                ComboBox7.ForeColor = Color.Red
                ComboBox8.ForeColor = Color.Red
            ElseIf ComboBox7.Text = ComboBox9.Text Then
                ComboBox7.ForeColor = Color.Red
                ComboBox9.ForeColor = Color.Red
            ElseIf ComboBox8.Text = ComboBox9.Text Then
                ComboBox8.ForeColor = Color.Red
                ComboBox9.ForeColor = Color.Red
            Else
                ComboBox7.ForeColor = Color.Black
                ComboBox8.ForeColor = Color.Black
                ComboBox9.ForeColor = Color.Black
            End If
        ElseIf ComboBox1.Text = ComboBox3.Text Or ComboBox1.Text = ComboBox6.Text Or ComboBox3.Text = ComboBox6.Text Then
            MessageBox.Show("You have two or more of the same weapon.", "Error!", MessageBoxButtons.OK, MessageBoxIcon******rmation)
        End If
#1 · 16y ago
treeham
treeham
Code:
       
     If ComboBox7.Text = ComboBox8.Text Or ComboBox7.Text = ComboBox9.Text Or ComboBox8.Text = ComboBox9.Text Then
            MessageBox.Show("You have two or more of the same perk.", "Error!", MessageBoxButtons.OK, MessageBoxIcon******rmation)
            If ComboBox7.Text = ComboBox8.Text Then
                ComboBox7.ForeColor = Color.Red
                ComboBox8.ForeColor = Color.Red
            ElseIf ComboBox7.Text = ComboBox9.Text Then
                ComboBox7.ForeColor = Color.Red
                ComboBox9.ForeColor = Color.Red
            ElseIf ComboBox8.Text = ComboBox9.Text Then
                ComboBox8.ForeColor = Color.Red
                ComboBox9.ForeColor = Color.Red
            Else
                ComboBox7.ForeColor = Color.Black //this will never happen
                ComboBox8.ForeColor = Color.Black //this will never happen
                ComboBox9.ForeColor = Color.Black //this will never happen
            End If
        ElseIf ComboBox1.Text = ComboBox3.Text Or ComboBox1.Text = ComboBox6.Text Or ComboBox3.Text = ComboBox6.Text Then
            MessageBox.Show("You have two or more of the same weapon.", "Error!", MessageBoxButtons.OK, MessageBoxIcon******rmation)
        End If
Those 3 in the else will never happen because:
Code:
//this is Treeham code so it will give you a ton of syntax errors if you try to compile it
If ComboBox7.Text = ComboBox8.Text Or ComboBox7.Text = ComboBox9.Text Or ComboBox8.Text = ComboBox9.Text Then
if anyofthose 3 happens then
turn them to red
if not,
turn them to black
end
end
#2 · 16y ago
PP
ppl2pass
why will they never happen.
cause if they those combbox.text arent the same they will turn to the colour black?
#3 · 16y ago
Shark23
Shark23
Quote Originally Posted by ppl2pass View Post
I need help for the code highlighted in red.
Code:
            If ComboBox7.Text = ComboBox8.Text Or ComboBox7.Text = ComboBox9.Text Or ComboBox8.Text = ComboBox9.Text Then
            MessageBox.Show("You have two or more of the same perk.", "Error!", MessageBoxButtons.OK, MessageBoxIcon******rmation)
            If ComboBox7.Text = ComboBox8.Text Then
                ComboBox7.ForeColor = Color.Red
                ComboBox8.ForeColor = Color.Red
            ElseIf ComboBox7.Text = ComboBox9.Text Then
                ComboBox7.ForeColor = Color.Red
                ComboBox9.ForeColor = Color.Red
            ElseIf ComboBox8.Text = ComboBox9.Text Then
                ComboBox8.ForeColor = Color.Red
                ComboBox9.ForeColor = Color.Red
            Else
                ComboBox7.ForeColor = Color.Black
                ComboBox8.ForeColor = Color.Black
                ComboBox9.ForeColor = Color.Black
            End If
        ElseIf ComboBox1.Text = ComboBox3.Text Or ComboBox1.Text = ComboBox6.Text Or ComboBox3.Text = ComboBox6.Text Then
            MessageBox.Show("You have two or more of the same weapon.", "Error!", MessageBoxButtons.OK, MessageBoxIcon******rmation)
        End If
Heres what your code does right now:
If ComboBox7.Text = ComboBox8.Text Then both boxes change colors. If that is untrue, then if ComboBox7.Text = ComboBox9.Text Then they change colors. If that is untrue then if ComboBox8.Text = ComboBox9.Text Then they change colors. Finally, if that is untrue then they all turn black.
What you need is:
Code:
'If box 7 and 8 are equal, they change to red. If not, they change to black.
            If ComboBox7.Text = ComboBox8.Text Then
                ComboBox7.ForeColor = Color.Red
                ComboBox8.ForeColor = Color.Red
            Else
                ComboBox7.ForeColor = Color.Black
                ComboBox8.ForeColor = Color.Black
            End If
'If box 7 and 9 are equal, they change to red. If not, they change to black.
          If ComboBox7.Text = Combobox9.Text Then
                 ComboBox7.ForeColor = Color.Red
                 ComboBox9.ForeColor = Color.Red
          Else
                 ComboBox7.ForeColor = Color.Black
                 ComboBox9.ForeColor = Color.Black
         End If

'If box 8 and 9 are equal, they change to re. If not, they change to black.
            If ComboBox8.Text = ComboBox9.Text Then
                ComboBox8.ForeColor = Color.Red
                ComboBox9.ForeColor = Color.Red
            Else
                ComboBox8.ForeColor = Color.Black
                ComboBox9.ForeColor = Color.Black
            End If
Right?
#4 · edited 16y ago · 16y ago
NextGen1
NextGen1
We should just have a sticky that says

Help ppl2pass

You make 5 new threads, Mpgh.net VB section is essentially writing everything for your uber duber releases

in all seriousness though, try to maintain one thread , especially if the content or question is similar to the last. You must be the winner for threadstarter of the day
#5 · 16y ago
SC
scimmyboy
at least he keeps this section up and running
#6 · 16y ago
NextGen1
NextGen1
meh, don't misunderstand me, I enjoy helping. And I am glad this section is active, even if it's by two people , I am simply stating as the minion of the section, similar content should be kept in similar threads, a thread tin regards to ElseIf (in a sense) was created not 20 mins before this.
#7 · 16y ago
SC
scimmyboy
makes the section more active
#8 · 16y ago
NextGen1
NextGen1
Quote Originally Posted by Justin View Post
makes the section more active
Even though you have been [banned] , I'll still respond.

This section has more posts / Views then C++
#9 · 16y ago
Obama
Obama
Don't even respond to Justin, isn't worth the hassle.
#10 · 16y ago
Erinador
Erinador
Quote Originally Posted by ilikewaterha View Post
Lol. I don't get it.. How is he talking is he's banned. WTF?
Obviously he posted that before he got banned.
#11 · 16y ago
PP
ppl2pass
here is the problem for this code shark23

Code:
'If box 7 and 8 are equal, they change to red. If not, they change to black.
            If ComboBox7.Text = ComboBox8.Text Then
                ComboBox7.ForeColor = Color.Red
                ComboBox8.ForeColor = Color.Red
            Else
                ComboBox7.ForeColor = Color.Black
                ComboBox8.ForeColor = Color.Black
            End If
'If box 7 and 9 are equal, they change to red. If not, they change to black.
          If ComboBox7.Text = Combobox9.Text Then
                 ComboBox7.ForeColor = Color.Red
                 ComboBox9.ForeColor = Color.Red
          Else
                 ComboBox7.ForeColor = Color.Black
                 ComboBox9.ForeColor = Color.Black
         End If

'If box 8 and 9 are equal, they change to re. If not, they change to black.
            If ComboBox8.Text = ComboBox9.Text Then
                ComboBox8.ForeColor = Color.Red
                ComboBox9.ForeColor = Color.Red
            Else
                ComboBox8.ForeColor = Color.Black
                ComboBox9.ForeColor = Color.Black
            End If
this will never work. what if box8 = box9 then those boxes will turn red but also black because it the other two arguments goes makes this statement useless.
#12 · 16y ago
PP
ppl2pass
fixed it myself using different method. lock plz.
#13 · 16y ago
XG
XGelite
it seems to me.. your method of doing this is over coded. Im not 100% what exactly your trying to do?
#14 · 16y ago
why06
why06
Quote Originally Posted by XGelite View Post
it seems to me.. your method of doing this is over coded. Im not 100% what exactly your trying to do?
Never like looking at the if then statements for VB. For being a high-level language it reminds me too much of a script. I don't understand why they would do it like that.

@NextGen1: And that's because C++ section has less noobs. Isn't that right ppl2pass.
#15 · 16y ago
Posts 1–15 of 16 · Page 1 of 2

Post a Reply

Similar Threads

  • Help with This Ramdom closing?By zanma in Combat Arms Help
    9Last post 16y ago
  • [Help]Hack Video & Issues[Closed]By /b/oss in Battlefield Bad Company 2 (BFBC2) Hacks
    6Last post 16y ago
  • [Help]Esp Hack Detected?[Closed]By samoanpure in Battlefield Bad Company 2 (BFBC2) Hacks
    6Last post 16y ago
  • [help]For each statement[Closed]By ppl2pass in Visual Basic Programming
    1Last post 16y ago
  • [Help]Download VB[Solved][Closed]By breaksafe in Visual Basic Programming
    3Last post 16y ago

Tags for this Thread

None