Advance Visual Basic

Moderators: None (Apply to moderate this forum)
Number of threads: 833
Number of posts: 1734

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Placing cursor in datagridview cell Posted by desaiva on 3 May 2011 at 12:09 AM

Hi there,

I have second column as datagridviewTextBoxColumn column in the datagridview, after opening dot net form runtime, in first cell of this column , I am populating ‘-‘ character at third position with remaining everything blank. Requirement is cursor should be at first position in this cell.

But now what is happening is, as my second column’s first cell should have cursor after opening form, we are sending tab key from first column to second column runtime with SendKeys.Send("{TAB}"), as result cursor is located after ‘-‘ which is not requirement , cursor should be at first position in cell.

How can we achieve this? I have given so many tries but still not able to sort it out, now it is urgent, please help me.

Thanks in advance.

Report
Re: Placing cursor in datagridview cell Posted by DaiMitnick on 4 May 2011 at 1:39 AM
Well the simplest solution I can see would be to after sending the command:

SendKeys.Send("{TAB}")

Send another for the home key:

SendKeys.Send("{HOME}")

Should work, let me know if not. Regards, Dai


------------------------------------------
Do or do not, there is no try. |
------------------------------------------



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.