VS 2008 Property Grid Sub Items To Have Properties Too?

Dec 5, 2011

i have a clsTest with the following layout:

vb
Public Class clsTest
Public Property Test1 as string
'...

[code]....

how can i make it so when i show clsTest's properties in a propertygrid it has the ability to expand clssettings properties? (kind of how font does it on a text box for example)

View 5 Replies


ADVERTISEMENT

VS 2008 Properties In 'groups' (class) In Designer (property Grid)?

Jul 29, 2009

I'm creating a UserControl that draws a simple radial gauge. I need it to be very customizable; the user should be able to customize everything such as the colors, fonts, sizes. So, I just made a property for every customizable detail. For example, I had ScaleFont, ScaleColor, ScaleStart, ScaleEnd, ScaleInnerRadius, ScaleOuterRadius, ScaleTickmarkFrequenty, etc.. etc.. etc...

Because there are so many properties about the same subject, I wanted to 'group' these properties into one "property". I've seen this done loads of times in third party controls, but I've never done it before myself.The idea is that the properties can be accessed like

Me.Gauge1.ScaleSettings.Start = 10
Me.Gauge1.ScaleSettings.End = 80
...

So far, I tried creating a class for each group, for example a clsScaleSettings class, containing properties like Font, Color, Start, End, InnerRadius, OuterRadius, TickmarkFrequenty, etc (corresponding to the same properties as above).

Then, for every 'group' or class, I create a Property. For example, I have the ScaleSettings property, which simply returns an instance of the clsScaleSettings class (I initialize the instance only once of course):

vb.net
Private _ScaleSettings As New clsScaleSettings
Public Property ScaleSettings() As clsScaleSettings

[code]....

Now, this works in the code editor. I can now use

Gauge1.ScaleSettings.Font = Me.Font

for example, and it sets the font correctly.But, I does not work in the designer, in the Property Grid. The whole reason I made the effort to move and rename nearly all properties (about 70!), and all references to those properties, to separate classes, was so that the user could design the gauge more easily using the Property Grid!Instead of having 15 settings related to the scale, scattered all over the Property Grid, he can now have one ScaleSettings property, which he can expand, and then he can edit the properties of that group easily.The ScaleSettings property is greyed out in the property grid... So I cannot expand it and view it's underlying properties.

View 16 Replies

Showing Properties Of Child Objects In The Property Grid?

Mar 9, 2010

I have a custom class (Class1) with a bunch of properties. One of the properties of this class is another custom class (Class2) with its own properties.I have a property grid with the selected object set to Class 1. I can see Class 2 as a property, but i would like to expand Class 2 to show its properties in the same property grid.

Im basically trying to do the exact same thing as the Font Class on a form. If you look at the properties of a form in the designer, you can see the font property. You can then expand that to show the properties of the font class.

View 1 Replies

Show The Error Provider Properties To Property Grid At Runtime?

Feb 23, 2011

In designer i had a button with errorprovider.The button show 3 extra properties at button's property grid in design time.Error on ErrorProvider1

IconAlignmnent on

IconPadding on

But how can i show this 3 extra properties in propertygrid at run time?

Private Sub Form_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim propertyGrid1 As New PropertyGrid()
propertyGrid1.CommandsVisibleIfAvailable = True[code].....

View 4 Replies

VS 2008 - Property Grid - Click On Item Show Its Property

Mar 18, 2009

I have a listbox with several list items added. I want that as user click on an item, I should be able to show its property. This should change for different items. For example (hypothetical) : Listbox has numbers 1 - 10. Now when I select 1 I should be able to set property - Name, Lastname, Colour, Age.

When I select 2 I should be able to set - Age, Hair Colour (clr shows), Weight, Date. When I select 3 then - City (combo box drop down), Country, Age only. This way value changes for diff items. One way is to put them in property grid and show them. Though this looks nice but adding/removing items in that is not easy. You need to have a class that refer that to prop grid. Do I have to code for each classes for all values in listbox or is there an easier way to manage items in property grid. If you think prop grid is not the right tool for such an activity then can you suggest something else.

View 13 Replies

VS 2008 Add Items Then Change Properties Of Those Items?

Sep 12, 2009

I know how to do what is in the subject already, but I want to do it a different way than what is stated in the subject. What I want to do is be able to create multiple items with different names and then load the names into a listbox. When I select the item in the listbox with the name, such as Item1, it will put the text from the control named Item1 into a textbox.

I am clueless as to how I could accomplish this. What I am doing is adding Items to a menustrip's dropdown Item, then adding items to the dropdown items. So I would have the item collection such as:

One
Two
Three

So I could choose the item in the listbox with the text "Three" and I could load several properties of the item Three. Such as Three.text, Three.Tag, and Three.Name. And I could also edit these. And then when Three is chosen in the listbox, I could add sub items to it.

So it would look like this in my perspective(Although the code would not work)

Dim tsmBookmarks_SubItem As New ToolStripMenuItem
(Listbox1.selecteditem).DropDownItems.Add(tsmBookmarks_SubItem)

how to convert string to a control name?

View 14 Replies

User Control Properties - Finalize My Design Time Properties Grid

Apr 27, 2011

I'm making a control and I am trying to finalize my design time properties grid. I have several List(of Class) items as public properties and when I click on the design time menu (while testing the control) there is the word "Collection" and a button with an ellipsis (...) that brings up a neat pop up with the buttons Add/remove and all of the public properties of the collection's class on the right hand side. Basically for a non-collection instance of a class (with public properties) I'd like a similar button to show up. I know I could put all of the properties in the main control class and group them, but I like the pop up box feature. Anyway to duplicate this? (think font grid item etc.)

View 3 Replies

VS 2008 Flag Enums In Property Grid

Jul 10, 2009

I have a flags enumeration property that I need to show in a property grid: [Code] In the property grid however, it only allows me to select a single value. I cannot combine the values like usual in a flags enum. How do I show something like a checked listbox in the property grid, so that the user can combine flags by checking items? A None and All item would be great but not required. [url]

But even that does not work properly. It seems to check and uncheck items arbitrarily. If you check the first and fourth item for example, the second and third items will sometimes be checked too. Yes, I realize that is supposed to happen with the TestEnum property (as that defines 'BottomRight' as 'Bottom Or Right', so that's logical), but it also happens with the SecurityFlags for example, which it shouldn't.

View 2 Replies

VS 2008 Can't Override ToString Of List(of T) For Purposes Of Property Grid?

Dec 13, 2011

Just say i have:

vb
Public Class Something
Inherits List(Of String)

[code].....

View 5 Replies

Net Property Grid. Is There A Way To Let The Grid Manipulate Object In Different Way

May 31, 2009

As I understood , The property grid is given an object which it can manipulate by extracting its Properties using reflections.

My problem is that I have a set of Parameters that is determined during run-time , thus I can't staticly compose a class with properties to represent this set.

I have two idea in mind to solve this problem but both are complex and will probably consume lot of time , infact i will say they are not practical under my time constraints. One is to use Reflection Emit in order to define a class dynamically and the other is to dynamiclly build a C# source file and then compile it using CodeDom.

Can Property grid behave in a different manner( other then extracting the Properties of an object using reflections ) that can suite my problem?

I want to say that the reason I went to the property grid from the begining was its ability to provide realy nice Data Retrieval UI for common types.For color you autometically get a palette , For dataTime you automatically have a nice calender. I would like to get those things automatically If possible.

View 1 Replies

Draw A Grid And Make A Map Using The Items On The Grid

Dec 28, 2009

I have an Idea but im not sure how to get started... Its a map maker... There will be a panel on the side for items and it will draw a grid and you can make a map using the items on the grid.

View 5 Replies

Set The Transparent Property Via Label Properties Properties Not Via Code?

Jan 16, 2009

I'm working on a Hazardous Materials label printing program. One of the options is to do an "NFPA" label. Since there are 4 values required with 4 or 6 options, the ratings are entered via radio buttons in a group box. That's working okay. I display values in the NFPA diamond as they're entered: left quadrant blue, top quadrant red, left yellow, bottom red. I'm having trouble with the label in which the rating will be displayed on top of a jpg diamond for the white. In this quadrant the text can be up to 4 characters. I can accept the text going into an adjacent block a little, but the corners of the label overlap into another quadrant/color. I reduced the font size which solved the overlap problem but the font is then too small and looks terrible. I tried to make the background of the label transparent to let the color come through correctly but that's not a valid value for label.background. I'm figuring that the transparent background is the best solution. What can I use that will accept a transparent background so the color shows through?

I'm trying to set the transparent property via label properties properties, not via code. Here's the code if it makes any difference:

Public Class NFPA
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Close()
End Sub

[code]....

View 2 Replies

IDE :: Make A Property In A Property Grid A List Box In 2010?

Feb 21, 2011

I have the following property in a property grid in VB.Net 2010.

<Description("Rapid Entry Post Car Wash Settings CarWashOptionPushButtons"), _
Category("Post Car Wash")> _
Public Property CarWashOptionPushButtons() As String

[code]....

I need to make this property a list box that gets the values from a database table and populates the list box with the values from the table. I have tried numerous things to no avail.

View 4 Replies

Property Grid - Open A Dialog Box To Edit A Property?

Oct 29, 2009

Property Grid - Open a dialog box to edit a property?

View 1 Replies

Sum The Properties Of Two Members Of A Collection Without Doing It Property By Property?

Aug 8, 2011

I've reviewed the links that were offered and don't find an answer. Neither has a lot of searching helped, probably because I can't think of a reasonably short way to ask the question. I hope that I've at least found the proper forum and category.

In my VB 2010 code, I've defined a structure that has about 30 elements. I want to sum the properties (they are all singles) of two members of the corresponding collection. I understand that I can do something like:

member1.property1=member2.property1+member 3.property1 for the entire set of properties of member2 and member3 to produce a completely defined member1 What I wonder is whether or not there is a way that uses fewer lines of code - I know that I can't do:member1=member2+member3, for example.

View 7 Replies

VS 2008 Items Collection Cannot Be Modified When The DataSource Property Is Set

Feb 13, 2010

I have two tables "Person" and "Alias" in a one to many relationship. I have a DGV for "Person" and want to use a combobox for the Aliases. I also have a textbox and a button for the user to type the alias name and click the button to add the alias name to the combobox and update the dataset. I keep getting the "Items collection cannot be modified when the DataSource property is set." Error. But if i use a DGV instead of a combobox for aliases, I have no errors and everything works fine. If I remove the datasource property for the combobox it will not get populated with the data already entered, so how, or can I, set it up where the combobox gets populated when the form loads and able to add items to the combobox????

View 1 Replies

VS 2008 Referencing A Property In The Parent ITEMS Class

May 6, 2010

I have a collection class, say ITEMS, that inherits a Dictionary (of String, SINGLEITEM). From the SINGLEITEM class, I would like to reference a property in the parent ITEMS class, what is the best way to do this? For example, say the ITEMS class has an IsDirty property and I would like to set that if ANY of the contained SINGLEITEM objects is modified, what's the best way to go about doing this?

I know I could add a reference to the collection class in each SINGLEITEM class (since I override the ADD method, I could make this assignment), but this seems like overkill.

View 1 Replies

Hide Or Omit Some Properties In Binding Of A Collection To Grid Control?

Mar 26, 2010

My problem is similar to the one described in this article, but I'm trying to use a different grid (DevExpress.xtraGrid) and therefore the answer (if it even works) does not apply for me: [URL]

Briefly, I'm binding the grid to the collection of custom objects - cMessage - to grid's datasource, but I don't want all the propertieties of the cMessage to be shown in the grid. Is there any way to hide some properties from the binding, while leaving them acessible from outside (ie.leave them as public or friend)?

View 2 Replies

VS 2005 Check Grid Items If Checked ListBox Items Checked?

Aug 21, 2009

Why is this code having the opposite effect? If It's checked in the checkedlistbox it's not check in my view, if it's not check in my checkedlistbox it is checked in the grid.

EDIT: More specifically. The CheckState.Checked is always the opposite. .Checked means it's not checked.

Private Sub CheckedListBox1_ItemCheck(ByVal sender As Object, ByVal e As System.Windows.Forms.ItemCheckEventArgs) Handles CheckedListBox1.ItemCheck
Try

[Code]....

View 2 Replies

Combo Box And A Property Grid In A Form?

Dec 15, 2011

I have a combo box and a property grid in a form. The combo box contains 2 items. If one item is selected, two properties are listed in the property grid. These properties should have a dropdown that contains a list of items. I have two string arrays that contain the values for these properties. Can I use one TypeConverter that inherits StringConverter for these lists to be displayed in two different properties? That is, with one TypeConverter class, can I populate both the lists? I will also have to do the same with the other items in the combo box.

View 2 Replies

Multiline Drop Down In Property Grid?

Jun 9, 2010

When you drop down the Text property for a label you get a box that allows text entry spanning multiple lines.My question is how do i use this feature in my own control properties?

View 2 Replies

Property Grid Collapsable Sections

Sep 20, 2010

The only thing I am coming up with in my searches is stuff to do with expandable type converters, and all of that documentation is a bit over my head as trying all the examples is failing horribly. I would assume that there is an easier way to go about this without junking up my code with more stuff I don't understand.[code]Now, variables 1-5 have to go under section1, which is what is going on now. However, I want to group together variables 1-4, then group together variables 5-8, so they have the plus sign and can expand. But I cannot apply another category to any of these as they already have a category. All of the other things I have tried putting in additional "<tryexpand("notgonnawork")> _" sections does exactly that, not gonna work.

View 10 Replies

Grid - How To Set DataField Property By Code In C1flexgrid

Dec 4, 2009

I am useing C1FlexGrid and i set the datatable as c1flexgrid's datasource. now i want to map filed of datatable to columns of c1flexgrid by code.

View 1 Replies

Use Property Grid In A Form To Edit Any Type?

Jul 22, 2009

I have an App where I'd like to be able to edit any type (font, colour, point etc.) at run time and use any of the .Net default type editors. (e.g., font/ colour picker).

Rather than re-invent the wheel, I decided to use the property grid control.

If I pass an object of, say font, to the grid, it lists all the fields separately, with no option to open the font picker.[code]...

View 1 Replies

Properties - Object Property?

Feb 15, 2012

I'm a C# coder, and I have trouble even reading VB.NET, so please forgive what may turn out to be an incredibly dumb question. But I have some code which looks like this:

CODE:

So, ignoring the fact that the syntax is probably wrong - how does VB.NET get the Name property from sourceObject? Inspecting it at run-time reveals that sourceObject is of a type that supports a property called Name with a getter, but what does VB.NET do in this case? Is there some extra code that is being generated by the compiler to somehow cast this automagically at run-time?

View 4 Replies

Use Reflection To Get A Properties Property?

Oct 6, 2010

I am trying to get the value of local path by doing the following[code]...

View 1 Replies

C# - Add A Service To The Type Descriptor Context Of A Property Grid In .Net?

Apr 13, 2010

I have an app that allows the user to choose an image, at design time, either as a straight image, or from an image list.

All cool so far, except that this is not happening from the visual studio property browser, its happening from a property grid that is a part of a type editor.

My problem is, both the image picker (actually resource picker), and the imagelist type converter rely on some design-time services to get the job done. In the case of imagelist, its the IReferenceService and in the case of the resource picker its a service called _DTE.

In the first instance of an edit from the visual studio property browser, I could get a reference to these services but (1) how can I add them to the type descriptor context of my property grid?

It would be better, for future proofing, if I could just copy a reference to all of the services in the type descriptor context. (2) Where does the property browser get these services from in the first place?

ETA: I still don't know how to do it, but I now know it is possible.

(1) Sub-class control and add a property whose type is an array of buttons.

(2) Add it to a form.

(3) Select the new control on the design service and edit the new property in the property browser.

(4) The collection editor dialog pops-up

(5) Add a button

(6) Edit image and image list - the type editor and type converter, respectively, behave as they should.

ETA2: Ok, I'm getting warm. It looks like you do it through the Site property of the property grid. I can create a new site, and pass it the type descriptor context I have a reference to and then it should have all the service. I'll give it a go ...

View 1 Replies

Setting Property Of A Data Grid View Control?

Nov 15, 2010

I am using VB 2008...

On my form I have a "Combobox1" that pulls a list from an access table. I also have a "DataGridView1" that pulls data from another access table.

I am trying to set the "DataSource" property of the "DataGridView1" after clicking a button, which pulls the "Text" property from the "ComboBox1".

ComboBox1.Text will always equal DataGridView1.DataSource as a text string.

I researched the Get/Set command, but it does not make sense to my specific application. I have read countless articles online for weeks, but I have now taken the next step.

View 1 Replies

Add Items To The Properties?

May 12, 2009

were I can get information on how I can add items to the Properties. Ok you know how you right click a file and goto properties well I wish to add a tab for hash checks. I have the program in my head how to do it but I don't know how to add tabs to the properties menu.

View 3 Replies

Properties Statement Used For Declaring Name Of A Property

Jun 28, 2009

i have read on the msdn and know properties statement used for declaring the name of a property, and the property procedures used to store and retrieve the value of the property.i learned about structure of it. but i cant figure out it clearly. [code]

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved