Question Textbox Cursor and Datagridview

stresss

Member
Joined
Aug 11, 2008
Messages
21
Programming Experience
Beginner
Hi all!

I have a question about textbox cursor and datagridview.

I have two panels, Top and Bottom Panel. Each panel consist of 2 textboxes,3 combobox.

What I want to achieve is what when I click one of the textbox in the Top panel, so the blink blink thing will be at that textbox, and at the same time, I select a row in the datagridview and it will display all the data in that row into that Top Panel.

Any idea on how to do this?

Thank you in advance!
 
Hello!

Hmmm any idea on how to do that? Cus I can't find the GotFocus Event of the Textbox.

Possible with some codes? :). Sorry for the trouble!.
 
Sure.

VB.NET:
    Private prv_isTopPanel = True

    Private Sub Textbox_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles textbox.GotFocus
        Me.prv_isTopPanel = True
    End Sub

    'click event of the DataGRidView with an If-Statement for prv_isTopPanel.

Bobby
 
Hmm I tried it, but there was erors.

Value of type 'Boolean' cannot be converted to 'System.Windows.Forms.GroupBox'.

'TopGB' is already declared as 'Friend WithEvents TopGB As System.Windows.Forms.GroupBox' in this class.


Actually my Top Panel is a GroupBox.
 
Ups, prv_IsTopPanel should a private variable declaration of type Boolean, which would be our flag, from where we determine if the user clicked the top panel or the bottom panel.

If it's true, he clicked the top panel, if it's false, he clicked the bottom panel.

Bobby
 
Hmmm i editted the code and there was no errors. But it couldn't work. Do i have to get the location of the blinking cursor then i can insert the data into the panel which the blinking cursor is?
 
Back
Top