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. Showing the Common properties for the Multiple Controls selection

Showing the Common properties for the Multiple Controls selection

Scheduled Pinned Locked Moved Visual Basic
csharpvisual-studio
2 Posts 2 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

    Actually i am having a list of controls in multiple Controls selections like Picturebox,Textbox ,Label,LinkLabel etc . Now i got Picturebox in the Multiple selection of control . In cCustomProperties Class i am having FORECOLOR ,BACKCOLOR ,FONT ,SIZE , LOCATION Common Properties class all the controls to show for multiple controls if selected in the propertygrid. Case :: 1 If i get the PICTUREBOX in the List Of Multiple Controls i want to hide the FONT,FORECOLOR,BACKCOLOR Properties and to show only LOCATION,SIZE PROPERTIES . Case :: 2 For LINKLABEL i am fixing the size of the Linklabel to 7,7 and label text as * .So if i get the linkLabel in the list of Multiple controls i want to hide the SIZE ,FORECOLOR,BACKCOLOR PROPERTIES Presently i am taking different class for all these conditions and doing Permutations & Combinations . Which is Risky THING TO DO THE THINGS . I want to Stop doing all these non-Sense things . I want to implement the way in visual studio if Multiple Controls are selected . In the PropertyGrid i get only the properties which are common to all the controls . Ex :: Consider the label and Picturebox in Multiple Selection. THE FONT PROPETY is hiding . IN THIS WAY DYNAMICALLY . Regards

    D 1 Reply Last reply
    0
    • V VB 8 0

      Actually i am having a list of controls in multiple Controls selections like Picturebox,Textbox ,Label,LinkLabel etc . Now i got Picturebox in the Multiple selection of control . In cCustomProperties Class i am having FORECOLOR ,BACKCOLOR ,FONT ,SIZE , LOCATION Common Properties class all the controls to show for multiple controls if selected in the propertygrid. Case :: 1 If i get the PICTUREBOX in the List Of Multiple Controls i want to hide the FONT,FORECOLOR,BACKCOLOR Properties and to show only LOCATION,SIZE PROPERTIES . Case :: 2 For LINKLABEL i am fixing the size of the Linklabel to 7,7 and label text as * .So if i get the linkLabel in the list of Multiple controls i want to hide the SIZE ,FORECOLOR,BACKCOLOR PROPERTIES Presently i am taking different class for all these conditions and doing Permutations & Combinations . Which is Risky THING TO DO THE THINGS . I want to Stop doing all these non-Sense things . I want to implement the way in visual studio if Multiple Controls are selected . In the PropertyGrid i get only the properties which are common to all the controls . Ex :: Consider the label and Picturebox in Multiple Selection. THE FONT PROPETY is hiding . IN THIS WAY DYNAMICALLY . Regards

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      I've never done anything like that before, but I can think of one method that might work. Enumerate the properties of each control. Put the property names in a collection and count the name of times each property is found for each control. Now go through the collection of property names and look at their count values. If the count equals the number of controls selected, you've found your common property names.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007, 2008

      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