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]Refreshing ComboBox[Solved]

Question[Help]Refreshing ComboBox[Solved]

Posts 1–11 of 11 · Page 1 of 1
PP
ppl2pass
[Help]Refreshing ComboBox[Solved]
nextgen1 i promise its going to be my last topic for today. please dont delete

ok so how do i refresh a comx with the options still there.

the long way:
clear the comx1
and add the items back in again.

is there a simpler methodÉ
#1 · 16y ago
Obama
Obama
comx.items.clear()
#2 · 16y ago
PP
ppl2pass
Quote Originally Posted by Drake View Post
comx.items.clear()
but that will clear all the options.
#3 · 16y ago
Obama
Obama
All the Refresh method of any control does is redraw it on-screen. It doesn't do anything else. If the binding hasn't been updated then redrawing it will have no effect.


Try

Code:
Form1_Load(Nothing, Nothing)
or


Code:
'refresh the datasource
combobox.datasource=?datasource
'select the new field from the table to populate the combobox with
combobox.displaymember = "New Display Member"
'redraw the combobox to reflect the values
combobox.invalidate()
#4 · edited 16y ago · 16y ago
NextGen1
NextGen1


Obama / Drake = Google King

Obama = (to an extent) right

The Combo-Box isn't actually Database bound (though it should be).

And I will never delete a post where someone needs help.

The Tab One was deleted for one reason or the other, probably for not using the proper rules of the section as posted.

Your best bet is to use access and create a (mdb) access Database, and Bind the database to the combo box, when you do that, all changes to the combo-box will auto refresh, and auto save.

I recommend this option for just about every item on a form that will have data the constantly is changing.

Id you need help creating and accessing a database, Im around

(note to in combo-box, there is a disable smiles for this post feature, great when writing code )
#5 · edited 16y ago · 16y ago
MJLover
MJLover
Quote Originally Posted by ppl2pass View Post
nextgen1 i promise its going to be my last topic for today. please dont delete

ok so how do i refresh a combo-box with the options still there.

the long way:
clear the comx1
and add the items back in again.

is there a simpler methodÉ
Yes, you can do it by saving the contents of the combo-box to a file. Clear the items and then reload.

Here's what you need to do:

Create a sub that will save and clear the items of the combo-box:
[php]Sub SaveAndClear()
Dim finalstr As String = ""
For Each n As String In Combo-Box1.Items
finalstr += n & vbCrLf
Next
My.Computer.FileSystem.WriteAllText(My.Computer.Fi leSystem.SpecialDirectories.MyDocuments & "\temp.xxx", finalstr, False)
Combo-Box1.Items.Clear()
End Sub[/php]

Then create a sub to reload the items:
[php]Sub reload()
If My.Computer.FileSystem.FileExists(My.Computer.File System.SpecialDirectories.MyDocuments & "\temp.xxx") Then
Dim n As String = My.Computer.FileSystem.ReadAllText(My.Computer.Fil eSystem.SpecialDirectories.MyDocuments & "\temp.xxx")
Dim x() As String = n.Split(ChrW(10))
For Each z As String In x
If Not z = vbNullString Then
Combo-Box1.Items.Add(z.Trim)
End If
Next
End If
End Sub[/php]

Finally call the subs as required:
For example I call them through buttons:
[php]Private Sub refresh_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
SaveAndClear()
End Sub
Private Sub ReloadItems_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ReloadItems.Click
reload()
End Sub[/php]

I hope this helps !!
#6 · 16y ago
Invidus
Invidus
Obama got banned 14,000 posts >.< sry off topic
#7 · 16y ago
NextGen1
NextGen1
Quote Originally Posted by MJLover View Post
Yes, you can do it by saving the contents of the combo-box to a file. Clear the items and then reload.

Here's what you need to do:

Create a sub that will save and clear the items of the combo-box:
[php]Sub SaveAndClear()
Dim finalstr As String = ""
For Each n As String In Combo-Box1.Items
finalstr += n & vbCrLf
Next
My.Computer.FileSystem.WriteAllText(My.Computer.Fi leSystem.SpecialDirectories.MyDocuments & "\temp.xxx", finalstr, False)
Combo-Box1.Items.Clear()
End Sub[/php]

Then create a sub to reload the items:
[php]Sub reload()
If My.Computer.FileSystem.FileExists(My.Computer.File System.SpecialDirectories.MyDocuments & "\temp.xxx") Then
Dim n As String = My.Computer.FileSystem.ReadAllText(My.Computer.Fil eSystem.SpecialDirectories.MyDocuments & "\temp.xxx")
Dim x() As String = n.Split(ChrW(10))
For Each z As String In x
If Not z = vbNullString Then
Combo-Box1.Items.Add(z.Trim)
End If
Next
End If
End Sub[/php]

Finally call the subs as required:
For example I call them through buttons:
[php]Private Sub refresh_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
SaveAndClear()
End Sub
Private Sub ReloadItems_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ReloadItems.Click
reload()
End Sub[/php]

I hope this helps !!
Agreed, but a bound database is still optimal, especially in design
#8 · 16y ago
mnpeepno2
mnpeepno2
combo box1.items.refresh()

BAM!!!
#9 · 16y ago
NextGen1
NextGen1
Not the same thing mnpeep, everyone here knows that

That method will refresh with current changes in memory, the OP want's to re-institute original data on refresh, which is why a form of database was suggested, it can update dynamically.
#10 · 16y ago
Taylor Swift
Taylor Swift
omg so confuzzling T_T
#11 · 16y ago
Posts 1–11 of 11 · Page 1 of 1

Post a Reply

Similar Threads

  • [Help] Save Items in Combobox[Solved]By FatCat00 in Visual Basic Programming
    8Last post 16y 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