Article View: be.comp.programming
Article #6158Last state ComboBox?
From: Kelly Smith
Date: Sun, 02 Feb 2003 12:45
Date: Sun, 02 Feb 2003 12:45
52 lines
2483 bytes
2483 bytes
Hello,
I have a combo box with text from 0 to 6 and the default is 0 , whenever I
restart the program it comes back to 0 which is the default. I would like it
to remember the last state or the current text before I closed the
application. Does anyone know how to handle this?
I prefered a registration method, but it gives errors. Does anyone know what
the problem could be?
In runtime it gives this problem:
Runtime-error "380"
Invalid property value
It writes to the registry, but it isn't loading it (Error). I tried to use
this method:
In the Form_QueryUnload:
SaveSetting App.Title, "Settings", "ComboBox", Str(Combo1.ListIndex)
In the Form_Load:
Combo1.ListIndex = Val(GetSetting(App.Title, "Settings", "ComboBox", 0))
My Combo Settings:
Style: DropDown List
...
Private Sub Combo1_Click()
Select Case Combo1.ListIndex 'ComboBox
Case 1 'Menu
Case 2 'Show
Case 3 'Anywhere
Case 4 'Moveable
Case 5 'Close
End Select
End Sub
...
With Combo1
.AddItem "None"
.AddItem "Menu"
.AddItem "Show"
.AddItem "Anywhere"
.AddItem "Moveable"
.AddItem "Close"
.ListIndex = 0
End With
Thank you in advance!
Kelly.
Technical Details
Message-ID:
<Xp8%9.713628$4B2.95569588@amsnews03.chello.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!207.217.77.43.MISMATCH!newsfeed1.earthlink.net!newsfeed.earthlink.net!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!colt.net!news-lond.gip.net!news.gsl.net!gip.net!skynet.be!skynet.be!213.51.129.3.MISMATCH!newshub1.home.nl!home.nl!amsnews01.chello.com!amsnews03.chello.com.POSTED!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fcea4,3ed0b6122816aaa0,start X-Google-Attributes: gidfcea4,public X-Google-ArrivalTime: 2003-02-02 04:46:44 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!207.217.77.43.MISMATCH!newsfeed1.earthlink.net!newsfeed.earthlink.net!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!colt.net!news-lond.gip.net!news.gsl.net!gip.net!skynet.be!skynet.be!213.51.129.3.MISMATCH!newshub1.home.nl!home.nl!amsnews01.chello.com!amsnews03.chello.com.POSTED!not-for-mail Reply-To: "Kelly Smith" <power@cable.a2000.nl> From: "Kelly Smith" <power@cable.a2000.nl> Newsgroups: be.comp.programming Subject: Last state ComboBox? Lines: 55 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2720.3000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Message-ID: <Xp8%9.713628$4B2.95569588@amsnews03.chello.com> Date: Sun, 02 Feb 2003 12:45:43 GMT NNTP-Posting-Host: 62.108.15.164 X-Complaints-To: abuse@chello.com X-Trace: amsnews03.chello.com 1044189943 62.108.15.164 (Sun, 02 Feb 2003 13:45:43 MET) NNTP-Posting-Date: Sun, 02 Feb 2003 13:45:43 MET Organization: chello broadband