C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Code Snippets » DataGridView »

Displaying various cursors and tool tip text for DataGridView columns


Posted Date: 15 Jul 2009    Resource Type: Code Snippets    Category: DataGridView
Author: Viji RAJKUMARMember Level: Diamond    
Rating: 1 out of 5Points: 10



The following VB.NET code snippet shows how to change the cursor for particular columns and to display the tool tip text for the particular columns of datagridview.

The CellMouseMove event of datagridview is used to handle this.

In this example, the Cursor Hand will be displayed for columns EDIT and DELETE





Private Sub dbGridView_CellMouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles dbGridView.CellMouseMove

If e.RowIndex >= 0 And e.ColumnIndex >= 0 Then

If e.ColumnIndex = dbGridView.Columns("EDIT").Index Or e.ColumnIndex = dbGridView.Columns("DELETE").Index Then

Me.Cursor = Cursors.Hand

'Set the Tool Tip

dbGridView.Rows(e.RowIndex).Cells(e.ColumnIndex).ToolTipText =
dbGridView.Columns(e.ColumnIndex).Name


Else

Me.Cursor = Cursors.Default

End If

End If

End Sub



While the mouse is moving over EDIT and DELETE columns of datagridview, the Cursor will be changed to Hand Cursor.




Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
Displaying various cursors and tool tip text for DataGridView columns  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Custom Built -DataGridView with Select /Deselect all checkbox
Previous Resource: Showing the data in a Datagrid from the database
Return to Discussion Resource Index
Post New Resource
Category: DataGridView


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use