|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Datagrid Context MenuIf I have a datagrid with an attached context menu, how can prevent the
context menu from opening if it is not over a row in the grid? Regards, owenmj assuming you are still on VS 2003.
Private Sub MyDataGrid_MouseDown(ByVal sender As Object, _ ByVal e As System.Windows.Forms.MouseEventArgs) _ Handles MyDataGrid.MouseDown Dim hi As System.Windows.Forms.DataGrid.HitTestInfo hi = MyDataGrid.HitTest(e.X, e.Y) ' Test if the clicked area was a cell. If hi.Type = DataGrid.HitTestType.Cell Then Me.MyDataGrid.ContextMenu = Me.GridContextMenu Me.manipulatedRow = hi.Row Me.manipulatedColumn = hi.Column Else Me.MyDataGrid.ContextMenu = Nothing End If End Sub Show quoteHide quote "owenmj" <owe***@discussions.microsoft.com> wrote in message news:B54E58E7-B15E-429A-81F4-28E0C19BE467@microsoft.com... > If I have a datagrid with an attached context menu, how can prevent the > context menu from opening if it is not over a row in the grid? > > Regards, > owenmj
Global Functions
Updating database in a loop System.Threading.Timer does not tick Looping through all Tables in a Database Aaron - You're becoming famous! control array Keys.Oem1 etc to real character vb.net - RunOnce key not executing at startup vb.net app error when running in master..xp_cmdshell Connection Pooling in .NET |
|||||||||||||||||||||||