Go to Post Dreams come and go, but once life throws a football you have to think fast. - Pavan Dave [more]
Home
Go Back   Chief Delphi > Technical > IT / Communications
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 22-01-2010, 10:53
KC1AJT's Avatar
KC1AJT KC1AJT is offline
Head Mentor
AKA: Patrick
FRC #6617 (Bellinghan High School Black Hawks Robotics Club)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2009
Location: Massachusetts
Posts: 185
KC1AJT is an unknown quantity at this point
Question Need Visual Basic Help

I am in the process of designing a scouting program.
I have the following code:
Private Sub teamnum_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles teamnum.KeyPress

Dim allowedChars As String = "0123456789"

If allowedChars.IndexOf(e.KeyChar) = -1 Then
' Invalid Character
e.Handled = True
End If

End Sub

But I would like to add the function of a backspace key.
__________________
Mentor - Team 6617
_____________________________________________
Student Years - Team 61

2011 Boston Regional
2011 BAE Systems/Granite State Regional
2010 Northeast Utilities FIRST Connecticut Regional Finalist
2010 Boston Regional
2009 Archimedes Division
2009 Connecticut Regional
2009 Boston Regional Regional Winner
  #2   Spotlight this post!  
Unread 22-01-2010, 11:04
riptide's Avatar
riptide riptide is offline
The Software Dude... LabView and VB
AKA: Jeff
FRC #1165 (Paradise)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Pasadena
Posts: 24
riptide will become famous soon enough
Re: Need Visual Basic Help

You have to use the ascii character for backspace which is 8.

Try this:

Dim allowedChars As String = "0123456789" + Chr(8)
  #3   Spotlight this post!  
Unread 22-01-2010, 11:06
Tristan Lall's Avatar
Tristan Lall Tristan Lall is offline
Registered User
FRC #0188 (Woburn Robotics)
 
Join Date: Aug 2001
Rookie Year: 1999
Location: Toronto, ON
Posts: 2,484
Tristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond repute
Re: Need Visual Basic Help

The solution to this problem in DOS-mode Pascal was to read ASCII character 8. In C, you would use \b or \x08. See this table for a VB constant called "vbBack" that may work equivalently.
  #4   Spotlight this post!  
Unread 22-01-2010, 11:11
KC1AJT's Avatar
KC1AJT KC1AJT is offline
Head Mentor
AKA: Patrick
FRC #6617 (Bellinghan High School Black Hawks Robotics Club)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2009
Location: Massachusetts
Posts: 185
KC1AJT is an unknown quantity at this point
Re: Need Visual Basic Help

Quote:
Originally Posted by riptide View Post
You have to use the ascii character for backspace which is 8.

Try this:

Dim allowedChars As String = "0123456789" + Chr(8)
Thanks! Works Perfectly!
__________________
Mentor - Team 6617
_____________________________________________
Student Years - Team 61

2011 Boston Regional
2011 BAE Systems/Granite State Regional
2010 Northeast Utilities FIRST Connecticut Regional Finalist
2010 Boston Regional
2009 Archimedes Division
2009 Connecticut Regional
2009 Boston Regional Regional Winner
  #5   Spotlight this post!  
Unread 22-01-2010, 11:13
riptide's Avatar
riptide riptide is offline
The Software Dude... LabView and VB
AKA: Jeff
FRC #1165 (Paradise)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Pasadena
Posts: 24
riptide will become famous soon enough
Re: Need Visual Basic Help

the constant vbBack will work as well.
  #6   Spotlight this post!  
Unread 22-01-2010, 17:15
KC1AJT's Avatar
KC1AJT KC1AJT is offline
Head Mentor
AKA: Patrick
FRC #6617 (Bellinghan High School Black Hawks Robotics Club)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2009
Location: Massachusetts
Posts: 185
KC1AJT is an unknown quantity at this point
Smile Re: Need Visual Basic Help

Thanks for all the answers, I will release the the database and cooresponding programs as soon as they are finished.
__________________
Mentor - Team 6617
_____________________________________________
Student Years - Team 61

2011 Boston Regional
2011 BAE Systems/Granite State Regional
2010 Northeast Utilities FIRST Connecticut Regional Finalist
2010 Boston Regional
2009 Archimedes Division
2009 Connecticut Regional
2009 Boston Regional Regional Winner
  #7   Spotlight this post!  
Unread 23-01-2010, 14:45
KC1AJT's Avatar
KC1AJT KC1AJT is offline
Head Mentor
AKA: Patrick
FRC #6617 (Bellinghan High School Black Hawks Robotics Club)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2009
Location: Massachusetts
Posts: 185
KC1AJT is an unknown quantity at this point
Re: Need Visual Basic Help

Ran into another issue I have a checkedlistbox with 6 checkboxes and would like to put code in a clear button to uncheck all of the 6 checkboxes.
__________________
Mentor - Team 6617
_____________________________________________
Student Years - Team 61

2011 Boston Regional
2011 BAE Systems/Granite State Regional
2010 Northeast Utilities FIRST Connecticut Regional Finalist
2010 Boston Regional
2009 Archimedes Division
2009 Connecticut Regional
2009 Boston Regional Regional Winner
  #8   Spotlight this post!  
Unread 24-01-2010, 08:25
Unsung FIRST Hero
Nate Smith Nate Smith is offline
FRC Key Volunteer Trainer
AKA: CrazyNate
no team
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Old Town, Maine
Posts: 1,029
Nate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to behold
Send a message via AIM to Nate Smith Send a message via Yahoo to Nate Smith
Re: Need Visual Basic Help

Two ways you can do it...

1. If they are the only checkboxes on the form(or panel, etc):
Code:
For each ctl as Control in Me.Controls
    If TypeOf ctl is Checkbox then CType(ctl, Checkbox).Checked = False
Next ctl
2. If there are other controls you don't want to mess with, you'll need to just specify each checkbox by name, such as:
Code:
CheckBox1.Checked=False
CheckBox2.Checked=False
...
__________________
Nate Smith
nsmith@smythsoft.com
12 seasons, 4 teams, and more time logged behind the scorekeeper's table than I care to remember...
returning for 2011? only time will tell...
  #9   Spotlight this post!  
Unread 24-01-2010, 12:22
riptide's Avatar
riptide riptide is offline
The Software Dude... LabView and VB
AKA: Jeff
FRC #1165 (Paradise)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Pasadena
Posts: 24
riptide will become famous soon enough
Re: Need Visual Basic Help

You want to try something like this. Place it in the ButtonUnchecked clicked sub.

For i As Integer = 0 To checklistbox1.Items.Count - 1
checklistbox1.SetItemChecked(i, False)
Next i
  #10   Spotlight this post!  
Unread 24-01-2010, 12:25
KC1AJT's Avatar
KC1AJT KC1AJT is offline
Head Mentor
AKA: Patrick
FRC #6617 (Bellinghan High School Black Hawks Robotics Club)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2009
Location: Massachusetts
Posts: 185
KC1AJT is an unknown quantity at this point
Re: Need Visual Basic Help

Ok I finally found it. After a day on Google, here's the code:


Dim i As Integer
For i = 0 To Me.CheckedListBox1.CheckedIndices.Count - 1
Me.CheckedListBox1.SetItemChecked(Me.CheckedListBo x1.CheckedIndices(0), False)
Next i
__________________
Mentor - Team 6617
_____________________________________________
Student Years - Team 61

2011 Boston Regional
2011 BAE Systems/Granite State Regional
2010 Northeast Utilities FIRST Connecticut Regional Finalist
2010 Boston Regional
2009 Archimedes Division
2009 Connecticut Regional
2009 Boston Regional Regional Winner
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

vB 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
Visual Basic basicxman IT / Communications 11 13-11-2007 23:43
Visual basic Help plz Jevin H IT / Communications 4 30-03-2007 18:57
Visual Basic help needed. Cody Carey Programming 1 25-02-2007 15:06
Visual Basic dddriveman Programming 12 20-03-2004 13:03
Help programming in Visual Basic xxlshortys Programming 0 06-04-2003 08:54


All times are GMT -5. The time now is 05:45.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi