Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Work on Ctrl +C in PropertyGridSelectedItem

Work on Ctrl +C in PropertyGridSelectedItem

Scheduled Pinned Locked Moved Visual Basic
questiontutorial
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    VB 8 0
    wrote on last edited by
    #1

    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 ??

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups