Work on Ctrl +C in PropertyGridSelectedItem
Visual Basic
1
Posts
1
Posters
0
Views
1
Watching
-
i am having a control on a panel and their properties in the propertygrid . How to identify the Ctrl + C in this method
Public Function PreFilterMessage(ByRef msg As Message) As Boolean Implements IMessageFilter.PreFilterMessage
Const WM\_KEYDOWN As Integer = 256 If msg.Msg = WM\_KEYDOWN Then Dim keyCode As Keys = (CType(CType(msg.WParam, Integer), Keys) And Keys.KeyCode) If pg.SelectedGridItem.PropertyDescriptor IsNot Nothing Then If (pg.SelectedGridItem.PropertyDescriptor.DisplayName = "Picture" Or \_ pg.SelectedGridItem.PropertyDescriptor.DisplayName = "BackgroundPicture" \_ And Not keyCode = Keys.Delete And Not (keyCode = Keys.Control And keyCode = Keys.C) \_ And Not (keyCode = Keys.Control And keyCode = Keys.V) \_ And Not (keyCode = Keys.Control And keyCode = Keys.X) \_ And Not (keyCode = Keys.Control And keyCode = Keys.A) \_ And Not (keyCode = Keys.Control And keyCode = Keys.Z) \_ And Not (keyCode = Keys.Control And keyCode = Keys.Y)) Then Return True End If End If End If Return False End Function
what i am doing is i am blocking keyboard characters and only Delete button i am allowing in the propertygrid for picture Property . When Ctrl C , or ctrl v or ctrl x or ctrl y or ctrl z is pressed i have to work on the control to copy ,paste etc if the the propertygrid.selecteditem is picture also how can i achieve this one ??