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] Setting Text Bold And Current StyleFont

[Help] Setting Text Bold And Current StyleFont

Posts 1–7 of 7 · Page 1 of 1
T0
T0P-CENT
[Help] Setting Text Bold And Current StyleFont
I know Tittle Isn't Clear
But What Basicly I want For Example When i set the font italic and then click on bold the text will be only bold not bold and italic i tried this code but didn't work
Code:
RichTextBox1.Font = New Font(RichTextbox1.Font , FontStyle.Bold Or RichTextBox1.Font.Style)
and also i tried to make it if the font is italic it set it bold and italic but it is not the point
i know this code works :
Code:
If Bold = False Then
            Bold = True
            Dim Style1 = Nothing
            Dim Style2 = Nothing
            Dim style3 = Nothing
            If Italic = True Then
                Style1 = FontStyle.Italic
            End If
            If Underwear = True Then
                Style2 = FontStyle.Underline
            End If
            If Strikeout = True Then
                style3 = FontStyle.Strikeout
            End If
            TextBoxx1.SelectionFont = New Font(TextBoxx1.Font, Style1 Or Style2 Or style3 Or FontStyle.Bold)
        Else
            Bold = False
            Me.TextBoxx1.SelectionFont = New Font(TextBoxx1.Font, FontStyle.Regular)
            Dim Style4 = Nothing
            Dim style5 = Nothing
            Dim Style6 = Nothing
            If Italic = True Then
                Style4 = FontStyle.Italic
            End If
            If Underwear = True Then
                Style5 = FontStyle.Underline
            End If
            If Strikeout = True Then
                style6 = FontStyle.Strikeout
            End If
            TextBoxx1.SelectionFont = New Font(TextBoxx1.Font, Style4 Or style5 Or Style6)
        End If
#1 · edited 15y ago · 15y ago
Jason
Jason
Don't use RichTextBox1.Font as the first parameter. That's a font type, not a font name.

RichTextBox1.Font.Name should be used. I.e

[php]
Dim f As New Font(RichTextBox1.Font.Name, 8, FontStyle.Bold Or FontStyle.Underline Or FontStyle.Strikeout Or FontStyle.Italic)
[/php]
#2 · 15y ago
NextGen1
NextGen1
If your creating a notepad application , you should use .selectionfont as well, this way you can target which words to bold & italic, not the entire box.

But IDK, I trust jason and didn't actually read much, just you had a font issue.
#3 · 15y ago
Jason
Jason
The only issue was that he was using

Code:
RichTextBox1.Font
For the "family name" parameter of the New Font constructor when it should have been
Code:
RichTextBox1.Font.Name
Other than that his code was correct.
#4 · 15y ago
T0
T0P-CENT
Quote Originally Posted by Jason View Post
The only issue was that he was using

Code:
RichTextBox1.Font
For the "family name" parameter of the New Font constructor when it should have been
Code:
RichTextBox1.Font.Name
Other than that his code was correct.
hmm yes i guess that was wrong but still the main problem isn't fixed but anyway thanks close please
#5 · 15y ago
Jason
Jason
I only skimmed the first part of your code, the second was too long and I got bored.
#6 · 15y ago
Blubb1337
Blubb1337
Don't we still have a snippet vault?
#7 · 15y ago
Posts 1–7 of 7 · Page 1 of 1

Post a Reply

Tags for this Thread

None