Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


How To Make A Simplelist Box

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Golden Wing
Grandmaster Cheater
Reputation: 0

Joined: 29 Aug 2007
Posts: 905

PostPosted: Sat Nov 10, 2007 11:38 am    Post subject: How To Make A Simplelist Box Reply with quote

language = vb6

how to make a list box you need:
Code:

1 listbox
3 command button
1 textbox

name command1 cmdAdd and caption "add"
name command2 cmdRemove and caption remove
name command3 cmdClear and make caption clear
name text1 txtAdd and clear the text

put this code in cmdAdd:
Code:
list1.additem text1.text


put this in cmdRemove:
Code:
list1.removeitem 0


put this in cmdClear:
Code:
list1.clear


or go to list1 select double click and put in list1.removeitem 0

their ya go Very Happy
Back to top
View user's profile Send private message
JakSplitter
Expert Cheater
Reputation: 0

Joined: 31 Aug 2006
Posts: 196

PostPosted: Sat Nov 10, 2007 1:46 pm    Post subject: Reply with quote

Good work, but it's not that hard to figure out, but good work anyways.
Back to top
View user's profile Send private message AIM Address
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Sat Nov 10, 2007 2:13 pm    Post subject: Reply with quote

xDemonRobbiex I'm actually proud of you. I remember when I was yelling at you with others for trying to do stuff way to advance, now your ploying your way through vb and even giving us tutorials, good ones at that. Way to go, + rep.
_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Golden Wing
Grandmaster Cheater
Reputation: 0

Joined: 29 Aug 2007
Posts: 905

PostPosted: Sat Nov 10, 2007 2:56 pm    Post subject: Reply with quote

oib111 wrote:
xDemonRobbiex I'm actually proud of you. I remember when I was yelling at you with others for trying to do stuff way to advance, now your ploying your way through vb and even giving us tutorials, good ones at that. Way to go, + rep.
thx Very Happy lol
Back to top
View user's profile Send private message
goldengold
Grandmaster Cheater Supreme
Reputation: -1

Joined: 11 Nov 2006
Posts: 1841
Location: -.-

PostPosted: Sat Nov 10, 2007 3:21 pm    Post subject: Reply with quote

though the down side is it's in VB
_________________
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Sat Nov 10, 2007 4:47 pm    Post subject: Reply with quote

Uh, xDemonRobbiex, don't use List1.Remove 0 to remove an item, that will remove the first item in the listbox and not the selected item. To remove the selected item use:

Code:
List1.RemoveItem List1.ListIndex


I also suggest you start reading up on error handling as things like this will cause errors over time. For example if the list is empty and you click a button it will error and kill the program unless you have proper error handling. To fix it for this case you can do something like:

Code:
Private Sub cmdRemove_Click()
On Error GoTo ErrorHandle
    '----------------------------------
    ' Check For Valid Item
    '----------------------------------
        If List1.ListIndex < 0 Then Exit Sub
    '----------------------------------
    ' Remove Selected Item
    '----------------------------------
        List1.RemoveItem List1.ListIndex
        Exit Sub
       
ErrorHandle:
    MsgBox Err.Description, vbCritical, "Error: " & Err.Number
End Sub


This way, first it checks if the ListIndex is less then 0, if so then exit the sub and do nothing. When the index is invalid, the return is -1. Next it will remove the selected item and exit the sub. (Note the Exit Sub, it is needed or it will call the ErrorHandle still.)

If an error occurs, 'On Error Goto ErrorHandle' tells the function/sub to goto the label 'ErrorHandle' which in this case is a message box to return the error description and number.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
oddmidge
Cheater
Reputation: 0

Joined: 09 Nov 2007
Posts: 40
Location: Melbourne Australia

PostPosted: Sat Nov 10, 2007 4:47 pm    Post subject: Reply with quote

Do any of use no the link for VB6 download i no its illegal but im only 12 and cant buy it
_________________
this is a signature part of my name which appears in all my post Smile
Back to top
View user's profile Send private message
Golden Wing
Grandmaster Cheater
Reputation: 0

Joined: 29 Aug 2007
Posts: 905

PostPosted: Sat Nov 10, 2007 5:09 pm    Post subject: Reply with quote

Wiccaan wrote:
Uh, xDemonRobbiex, don't use List1.Remove 0 to remove an item, that will remove the first item in the listbox and not the selected item. To remove the selected item use:

Code:
List1.RemoveItem List1.ListIndex


I also suggest you start reading up on error handling as things like this will cause errors over time. For example if the list is empty and you click a button it will error and kill the program unless you have proper error handling. To fix it for this case you can do something like:

Code:
Private Sub cmdRemove_Click()
On Error GoTo ErrorHandle
    '----------------------------------
    ' Check For Valid Item
    '----------------------------------
        If List1.ListIndex < 0 Then Exit Sub
    '----------------------------------
    ' Remove Selected Item
    '----------------------------------
        List1.RemoveItem List1.ListIndex
        Exit Sub
       
ErrorHandle:
    MsgBox Err.Description, vbCritical, "Error: " & Err.Number
End Sub


This way, first it checks if the ListIndex is less then 0, if so then exit the sub and do nothing. When the index is invalid, the return is -1. Next it will remove the selected item and exit the sub. (Note the Exit Sub, it is needed or it will call the ErrorHandle still.)

If an error occurs, 'On Error Goto ErrorHandle' tells the function/sub to goto the label 'ErrorHandle' which in this case is a message box to return the error description and number.


yea thx i had trouble with that
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites