OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-12-2002, 13:49
Steve
Guest
 
Posts: n/a
Default Question about Combo Boxes

I have a ComboBox that has 3 items (1, 2, 3 litrally). How can I advance the value of the ComboBox by 1 every time a Command button (OK) is pressed? It's just to present the user with a default, but it's kind of needed.

Thanks
Steve
________
UNIVERSAL HEALTH WAREHOUSE

Last edited by Steve; 12-03-2011 at 00:28.
Reply With Quote
  #2  
Old 11-12-2002, 18:23
Steve
Guest
 
Posts: n/a
Default Never mind... figured it out.. what I did inside

You guys probably know all this but...

Code:
    If ComboBox12.Value = 3 Then
        ComboBox12.Value = 1
    Else
        CN = ComboBox12.Value + 1
        ComboBox12.Value = CN
   End If
Thanks. More questions coming I'm sure
________
Honda Cbf600

Last edited by Steve; 12-03-2011 at 00:28.
Reply With Quote
  #3  
Old 12-12-2002, 10:25
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default Re: Never mind... figured it out.. what I did inside

Using Value property of combobox may not be the best idea. It will work if you have only numbers in the list (as I'm sure you do in this case), but if you have any strings in there, Value will return a string and it may not be possible to convert it to a number.

Instead, you should use ListIndex property which specifies the index of list item currently selected. It is 0 for the first item selected and so on. If there is no selection, ListIndex returns -1.

I hope this helps.
Reply With Quote
  #4  
Old 12-12-2002, 13:33
Steve
Guest
 
Posts: n/a
Default Thanks

Thanks for the help! In this case it was liturally numbers and it works. Should I still use an index as a practice even in litural number values? Thanks for your help!
________
Mkx

Last edited by Steve; 12-03-2011 at 00:28.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Icon Question dungbtl CorelDRAW/Corel DESIGNER VBA 0 17-03-2005 17:37
question sejal01 CorelDRAW/Corel DESIGNER VBA 1 22-12-2004 21:27
Need help connecting to database and filling combo box CamWest CorelDRAW/Corel DESIGNER VBA 6 22-12-2004 13:30
Question about toolbar -=HKLC=- CorelDRAW/Corel DESIGNER VBA 1 16-10-2004 14:33
The CommandBar to linke the VB Form question levin CorelDRAW/Corel DESIGNER VBA 1 24-08-2003 12:40


All times are GMT -5. The time now is 02:13.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com