Click here to Skip to main content
15,902,938 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Datagrid Relationship Pin
Vimalsoft(Pty) Ltd5-Sep-07 0:07
professionalVimalsoft(Pty) Ltd5-Sep-07 0:07 
QuestionInvoke event inside Flash ActiveX in VB Pin
sunco2-Sep-07 10:06
sunco2-Sep-07 10:06 
AnswerRe: Invoke event inside Flash ActiveX in VB Pin
Dave Kreskowiak3-Sep-07 4:36
mveDave Kreskowiak3-Sep-07 4:36 
QuestionAccessing exchange server public folders Pin
manisghouri2-Sep-07 8:49
manisghouri2-Sep-07 8:49 
QuestionGetting the outermost Document object in webbrowser control Pin
Ahmad Zaidi2-Sep-07 4:10
Ahmad Zaidi2-Sep-07 4:10 
QuestionDatagridView row selection Pin
Mr Oizo2-Sep-07 3:13
Mr Oizo2-Sep-07 3:13 
AnswerRe: DatagridView row selection Pin
Widgets2-Sep-07 14:52
Widgets2-Sep-07 14:52 
Questionplease help me with combobox keycode Pin
bapu28892-Sep-07 2:16
bapu28892-Sep-07 2:16 
hi
i am working on my assingment about pong game and it's almost done but i just want to provide control option for user so they can select their choice for control keys to control right and left paddle

so i have use module to pass the info. for another form but it's not working, so can anybody help me with this
'''
this is the code for module
<br />
Module Module1<br />
Public MyKeys(4) As Keys<br />
<br />
Public Sub main()<br />
Dim MyForm1 As New frmStart<br />
MyForm1.Show()<br />
Application.Run()<br />
End Sub<br />
End Module



'''''

this is for form load


Private Sub frmStart_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
cboKey1.Items.Add(Keys.Up)<br />
cboKey1.Items.Add(Keys.Down)<br />
cboKey1.Items.Add(Keys.Right)<br />
cboKey1.Items.Add(Keys.Left)<br />
cboKey1.Items.Add(Keys.A)<br />
cboKey1.Items.Add(Keys.Z)<br />
cboKey1.Items.Add(Keys.K)<br />
cboKey1.Items.Add(Keys.M)<br />
cboKey1.Items.Add(Keys.S)<br />
cboKey1.Items.Add(Keys.X)<br />
cboKey1.SelectedIndex = 0<br />
For I As Integer = 0 To cboKey1.Items.Count - 1<br />
cboKey2.Items.Add(cboKey1.Items.Item(I))<br />
cboKey3.Items.Add(cboKey1.Items.Item(I))<br />
cboKey4.Items.Add(cboKey1.Items.Item(I))<br />
<br />
Next<br />
cboKey2.SelectedIndex = 0<br />
cboKey3.SelectedIndex = 0<br />
cboKey4.SelectedIndex = 0<br />
MyKeys(1) = cboKey1.SelectedItem<br />
MyKeys(2) = cboKey2.SelectedItem<br />
MyKeys(3) = cboKey3.SelectedItem<br />
MyKeys(4) = cboKey4.SelectedItem<br />
Timer1.Enabled = True<br />
End Sub
'''

and this code is for keydown event for another form

Private Sub frmPong_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown<br />
For J As Integer = 1 To 4<br />
Select Case MyKeys(J)<br />
Case MyKeys(1)<br />
MyBat1.Y -= 10<br />
Case MyKeys(2)<br />
MyBat1.Y += 10<br />
Case MyKeys(3)<br />
MyBat2.Y -= 10<br />
Case MyKeys(4)<br />
MyBat2.Y += 10<br />
End Select<br />
Next<br />
End Sub
'''''


and code for button click


Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
Dim MyForm As New frmPong<br />
MyForm.Show()<br />
MyKeys(1) = cboKey1.SelectedIndex<br />
MyKeys(2) = cboKey2.SelectedIndex<br />
MyKeys(3) = cboKey3.SelectedIndex<br />
MyKeys(4) = cboKey4.SelectedIndex<br />
Me.Hide()<br />
End Sub

'
'

so when application start the first form shows option for user and when user click buttton it's load selected controls for user

that's the hole idea

please help me with this problem
Cry | :((
Confused | :confused:

please please please
AnswerRe: please help me with combobox keycode Pin
Lucky Sheikh6-Sep-07 20:40
Lucky Sheikh6-Sep-07 20:40 
QuestionReplace multiple space with Single space in RichTextBox Pin
Rupesh Kumar Swami2-Sep-07 2:11
Rupesh Kumar Swami2-Sep-07 2:11 
AnswerReplace multiple space with Single space in RichTextBox Pin
Chatura Dilan2-Sep-07 3:24
Chatura Dilan2-Sep-07 3:24 
AnswerRe: Replace multiple space with Single space in RichTextBox Pin
Luc Pattyn2-Sep-07 4:04
sitebuilderLuc Pattyn2-Sep-07 4:04 
Questioncombobox questions Pin
xebe2-Sep-07 0:11
xebe2-Sep-07 0:11 
AnswerRe: combobox questions Pin
Rupesh Kumar Swami2-Sep-07 0:45
Rupesh Kumar Swami2-Sep-07 0:45 
GeneralRe: combobox questions Pin
xebe2-Sep-07 4:02
xebe2-Sep-07 4:02 
GeneralRe: combobox questions Pin
Rupesh Kumar Swami2-Sep-07 19:19
Rupesh Kumar Swami2-Sep-07 19:19 
AnswerRe: combobox questions Pin
Widgets2-Sep-07 14:58
Widgets2-Sep-07 14:58 
AnswerRe: combobox questions Pin
arjunjagtap2-Sep-07 19:39
arjunjagtap2-Sep-07 19:39 
Questioncombobox problem Pin
SamRST1-Sep-07 22:49
SamRST1-Sep-07 22:49 
AnswerRe: combobox problem Pin
Vasudevan Deepak Kumar1-Sep-07 23:09
Vasudevan Deepak Kumar1-Sep-07 23:09 
Questionpls help! Pin
Rharzkie1-Sep-07 20:51
Rharzkie1-Sep-07 20:51 
GeneralRe: pls help! Pin
Guffa1-Sep-07 22:04
Guffa1-Sep-07 22:04 
Questionxml &amp;amp; Vb.net Pin
MrScruff6661-Sep-07 13:03
MrScruff6661-Sep-07 13:03 
AnswerRe: xml &amp;amp; Vb.net Pin
Christian Graus1-Sep-07 13:20
protectorChristian Graus1-Sep-07 13:20 
QuestionConnection string for an access database Pin
Mr Oizo1-Sep-07 8:46
Mr Oizo1-Sep-07 8:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.