Click here to Skip to main content
15,915,600 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionUpgrade to Visual Studio 2003? Pin
James Williams26-Dec-02 7:24
James Williams26-Dec-02 7:24 
AnswerRe: Upgrade to Visual Studio 2003? Pin
Michael P Butler26-Dec-02 7:43
Michael P Butler26-Dec-02 7:43 
GeneralCould anybody help me in visual basic Pin
suresh_sathya25-Dec-02 23:27
suresh_sathya25-Dec-02 23:27 
QuestionHow can I bind data to Groupbox of radiobuttons Pin
intibnin24-Dec-02 22:57
intibnin24-Dec-02 22:57 
AnswerRe: How can I bind data to Groupbox of radiobuttons Pin
Tatham26-Dec-02 6:31
Tatham26-Dec-02 6:31 
GeneralRe: How can I bind data to Groupbox of radiobuttons Pin
intibnin26-Dec-02 20:45
intibnin26-Dec-02 20:45 
GeneralRe: How can I bind data to Groupbox of radiobuttons Pin
Tatham26-Dec-02 20:55
Tatham26-Dec-02 20:55 
QuestionHow Can i detect return key in datagridTextBoxColumn Pin
intibnin24-Dec-02 22:49
intibnin24-Dec-02 22:49 
Hi,
Please I need help.
I created a form that allows me searching customers by name. after display customers list in datagrid, i want allow user to select one customer by pressing key.
for grid setup, i tried the following code :

'Configuration de la grille
Private Sub DataGridSetup()
Dim ts As New DataGridTableStyle()
Dim cs As New DataGridTextBoxColumn()
AddHandler cs.TextBox.KeyPress, AddressOf CellKeyPress
DataGrid1.ContextMenu = ContextMenu1
DataGrid1.CaptionText = "Résultat"
ts.MappingName = "mycli"
cs.MappingName = "c_cli"
cs.HeaderText = "Code"
cs.Alignment = HorizontalAlignment.Center
ts.GridColumnStyles.Add(cs)
cs = New DataGridTextBoxColumn()
cs.MappingName = "N_cli"
cs.HeaderText = "Nom/Raison sociale"
ts.GridColumnStyles.Add(cs)
DataGrid1.TableStyles.Clear()
DataGrid1.TableStyles.Add(ts)
End Sub

and i added handler to datagridtextboxcolumn, for detecting the keypress events as follows :

'Ajout d'un évènement aux cellules
Public Sub CellKeyPress(ByVal Sender As Object, ByVal e As KeyPressEventArgs)
Dim dt As DataTable = ds.Tables("mycli")
Dim p As Integer
CodeClient = Space(11)
If e.KeyChar = Chr(13) Then
p = Me.BindingContext(ds, "mycli").Position
CodeClient = dt.Rows(p)("c_cli")
Me.Close()
End If

End Sub


So after writing this code, i can select one customer only after pressing SHIFT+RETURN.

please can you explain me way i must first press
SHIFT.

Thank you very match.

Intibnin...



***
AnswerRe: How Can i detect return key in datagridTextBoxColumn Pin
Tatham26-Dec-02 6:44
Tatham26-Dec-02 6:44 
GeneralRe: How Can i detect return key in datagridTextBoxColumn Pin
intibnin30-Dec-02 4:55
intibnin30-Dec-02 4:55 
GeneralRe: How Can i detect return key in datagridTextBoxColumn Pin
Tatham30-Dec-02 5:03
Tatham30-Dec-02 5:03 
Generaltoolbar_button click Pin
Anonymous24-Dec-02 10:30
Anonymous24-Dec-02 10:30 
GeneralRe: toolbar_button click Pin
Nick Seng25-Dec-02 15:48
Nick Seng25-Dec-02 15:48 
GeneralLabelArray and MenuItemArray Pin
Ilan Ehrenfeld23-Dec-02 23:34
Ilan Ehrenfeld23-Dec-02 23:34 
GeneralRe: LabelArray and MenuItemArray Pin
Nick Seng25-Dec-02 15:40
Nick Seng25-Dec-02 15:40 
GeneralLaunching executable file Pin
Desmond23-Dec-02 7:42
Desmond23-Dec-02 7:42 
GeneralRe: Launching executable file Pin
Ray Cassick23-Dec-02 9:29
Ray Cassick23-Dec-02 9:29 
QuestionHow to pass a ADO object as a parameter to a function? Pin
Anonymous22-Dec-02 17:25
Anonymous22-Dec-02 17:25 
AnswerRe: How to pass a ADO object as a parameter to a function? Pin
Nick Seng22-Dec-02 17:57
Nick Seng22-Dec-02 17:57 
GeneralRe: How to pass a ADO object as a parameter to a function? Pin
Anonymous22-Dec-02 18:40
Anonymous22-Dec-02 18:40 
GeneralRe: How to pass a ADO object as a parameter to a function? Pin
Nick Seng22-Dec-02 20:01
Nick Seng22-Dec-02 20:01 
GeneralRe: How to pass a ADO object as a parameter to a function? Pin
Anonymous22-Dec-02 20:41
Anonymous22-Dec-02 20:41 
GeneralRe: How to pass a ADO object as a parameter to a function? Pin
Ray Cassick23-Dec-02 7:02
Ray Cassick23-Dec-02 7:02 
GeneralRe: How to pass a ADO object as a parameter to a function? Pin
Nick Seng25-Dec-02 14:48
Nick Seng25-Dec-02 14:48 
GeneralRe: How to pass a ADO object as a parameter to a function? Pin
Jason McBurney10-Jan-03 13:30
Jason McBurney10-Jan-03 13:30 

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.