Change The TypeConverter Attribute Of A Property At Runtime?
Dec 20, 2011
I have a class created for use with the PropertyGrid control in a VB.Net application. One of the properties of the class is:
Private _someProp As String
<Browsable(True), _
BindableAttribute(False), _
[code].....
View 1 Replies
ADVERTISEMENT
Mar 24, 2009
I have done some searching, but am still having trouble trying to set the browsable attribute of property to false at runtime in order to hide in the properties grid control (based on certain conditions).
View 9 Replies
May 17, 2011
I have a Winforms project that is loosely based on MVVM. Security is implemented by the domain layer by using the PrincipalPermissionAttribute, [cod]e...
View 1 Replies
Mar 6, 2010
How can I shift the GET-implementation of a Class property to a / using a custom attribute? (I've added instantation vars (classname, propertyname) to the attribute, however I'd rather have these automatically fetched ofcourse.)
Public Class CustomClass
<CustomAttributeClass(ClassName:="CustomClass", PropertyName = "SomeProperty")> _
Public Property SomeProperty() as String
Get() as String
[code]....
View 3 Replies
Sep 24, 2009
start with I was given a program by a friend that was created in Excel 2003 with the help of Visual Basic Editor. He said he used Visual Basic 2003, which he is not 100% sure about. Anyways he used CurLine in the program and when I try to open it in Excel 2007 and then open the Visual Basic Editor and run the program I get the following error:Run-time error '-2147418113 (8000ffff)':Could not get the CurLine property. Unexpected call to method or property access.
View 2 Replies
Aug 4, 2010
i wrote a custom attribute and got the following Color property that I want the user to be able to indicate the color property in the attribute on a class:
Private _ColumnColor As System.Drawing.Color
Public Property ColumnColor() As System.Drawing.Color
Get
[Code]....
View 1 Replies
Jan 18, 2012
[Code]...
Why is the first line not correct? What it wants is a System.Type and a System.String but refuses to work.
View 15 Replies
Mar 10, 2010
I inherits textbox Control and I added some new properties to it .one of these properties value i want it to change it's value in desgin time when i change Name property of the new textbox
Public Class NewTextBox
Inherits TextBox
Private _txtSubName As String = String.Empty
That is the property for set or get SubstringName of Textbox
Public Property SubName() As String
Get
Return _txtSubName[code].....
that's the property i want to change it's value when i change Name property of the control.i tried to overrides Name property but it's not overridable also i trieds to overloads it but it doesn't work in desgin time.Here is something i tried but it's wronge.
Private _txtName As String = ""
Public Overloads Property Name() As String
Get[code]......
View 4 Replies
Apr 9, 2009
I think know how to do this in C# but I'm having syntax trouble in VB.NET because I need to take advantage of the 'handles' event stuff. I have different events that I somehow (probably delegate) need stored in a property of an attribute (I just add an attribute to a property linking to the corresponding event).
E.g.
<BindEvent(EventThing)>_
Public ReadOnly Property IsTrue() As Boolean
Get
Return True
End Get
End Property
They need to be events so that other programmers can use the VB.NET handles keyword on methods.
Public Delegate Sub TestEvent(ByVal sender As Object, ByVal e As Object)
Public Event E As TestEvent
Public Sub Test() Handles E
End Sub
These properties are already raising a general event, which I am catching, determining the related property and thus getting the related attribute (and delegate/event). I want to then raise the event that's related. If I just use a delegate tied to the particular event that won't raise other handlers will it? I also want to avoid having to write a sub for each property that just uses Raise Event on the event type if possible as this seems redundant.
E.g. avoid:
Public Event E As TestEvent
Public Sub CallE(ByVal sender As Object, ByVal e As Object)
RaiseEvent E(sender, e)
End Sub
[Code] .....
View 2 Replies
Jan 20, 2010
Consider this scenario:
Class MyClass
Property SubProp1
End Property
[code]....
Next, I put an instance of MyButton into a property grid, expand property MC and edit SubProp2.From the type editor for SubProp2, I want to get hold of the attribute applied to property MC.Looking at the context,PropertyDescriptor.ComponentType, we arrive at Type: MyClass.If i look at the attributes applied to MyClass, though, it will only return the attributes applied directly to MyClass, and not the extra attribute applied to the property MC.
View 2 Replies
Feb 15, 2010
I have code for a custom DateTimePicker in this thread.>> Do I need to add an attribute to the properties to instantly show changes in design view please
View 8 Replies
Jun 21, 2010
I have valued pairs, attributes names and values in one hand, and I have an object with attributes. I need to set the values of those attributes. I need something like [code]
View 1 Replies
Dec 15, 2010
I working in VB.Net 2010 framework 2.0..I am using the TypeConverter url...How typeconverter can return me the Color instead of string . Currently it is returning the color in form of string. waht i have to do to get the color.I an using <TypeConverter(GetType(MyTypeConverter))> for backcolor property of custom panel.My requirement is that only for some colors, i need the string and for rest of the colors, i want the original color value of backcolor of panel.[code]
View 4 Replies
Dec 29, 2011
I was just wondering if it is possible to apply an attribute to a property within a business object (MyBusinessObject) such that after the DataSource of a grid is set to a List(Of MyBusinessObject), the visible property of the column will automatically be false. For example:
myGrid.DataSource = New List(Of MyBusinessObject)
Public Class MyBusinessObject
[code]....
View 1 Replies
Feb 17, 2010
I have a simple class that I trying to populate from an XML document. The XML file has an attribute called TrackingID in the root node which I would like to get as a property. For some reason, when I deseralize the class, the TrackingID is null. Everything else populates fine. I have tried various attributes on the TrackingID property with no luck.
[Code]...
View 1 Replies
Feb 15, 2010
I had a strange problem editing a class in the property grid whereby the property grid would refresh incorrectly.I managed to reduce the problem down to a class with just two properties. I've included the code at the end to ease explanation.It basically boils down to a class with two properties. The first of which is expandable (a font)The class itself is expandable and also implements the CreateInstance method in the type converter.To see the problem, expand the font, edit, say 'Bold', and tab away. Two problems happen:
(1) The second property jumps up and ends up in the expanded font property.
(2) The '-' sign of the expanded font changes to a '+'.
The problem goes away by attaching ResfreshProperties(RefreshProperties.All) to the class. That's great, but I'd like to understand how it fixed the problem. I've had a look in reflector and can't find any examples of RefreshProperties being attached at the class level.
[code]...
View 1 Replies
Sep 5, 2010
I have a big XML files with lots of Attribute names and Values.
How to get all attribute name and check with user specified name, and change its value not name..
<cont>
<have>
<xmls>
[Code].....
I want to find a specific attribute name and change the value of it...
View 9 Replies
Feb 6, 2012
If I want to chand the background color of all the child windows opened i would use this:
For Each chld As Form In Me.MdiChildren
chld.BackColor = Color.LightGray
Next chld
View 2 Replies
Oct 16, 2011
I have a userControl that I made, and it was placed on a form with other controls.On the form I pass the values from the other controls to a Function inside the userControl, this then takes the values passed in and the values on the userControl to make and return an object.
The Problem is that when it gets down to '.GameOppScore = OppScore' it decrements .GameScore by 1 and then decrements .GameOppScore by 1. It does nothing to the passed in values or the value in the input text box.
It just randomly decides to -1, I walked through the code while running and couldn't find a reason why it would do that.
[Code]...
View 2 Replies
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 combobox.
View 1 Replies
Apr 11, 2011
I got a properties class that I send to a PropertyGrid. I want to change the [readonly] attribute of some properties in realtime. Below is an example of such a property in vb.net...
<CategoryAttribute("Graph Limits"), _
Browsable(True), _
[ReadOnly](False), _
BindableAttribute(False), _
[code]....
View 2 Replies
Sep 10, 2011
how do you change the LastModified attribute of a file without opening it?
View 1 Replies
Feb 6, 2012
If I want to chand the background color of all the child windows opened i would use this:
For Each chld As Form In Me.MdiChildren
chld.BackColor = Color.LightGray
Next chld
But how can I modify the color of a textbox found on the child forms?
View 1 Replies
Jan 13, 2010
I'm working on a simple base form in which all the other forms in the project will inherit. This base form only adds 5 properties (at the moment) dealing with painting a gradient background. The problem I'm facing right now is when I change a property on Form1 (the test form) and click run it doesn't show that change. I also checked the .designer.vb file and when I make a change it's not added to the code behind file, I'm at a loss right now to why.
[Code]...
View 5 Replies
Nov 27, 2011
here any algorithms/pseudocode for reading/parsing 3-column csv data and determining unique objects/attributes/values?
example data:
john,height,1.75
george,age,21
[Code]....
i have already implemented a solution of my own but it's too slow and i can't find any relevant literature on the internet.
View 6 Replies
Nov 10, 2011
Possible Duplicate: Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive
I am using window xp and iis 5.1 to run the application.
error is occurred Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive.
[Code]...
View 2 Replies
Nov 17, 2009
I'm writing a debug dump for my app and need to know which Method or Property caused the error along with a trace of the last few routines.
View 3 Replies
Aug 12, 2011
How to declare property which can be modified in project mode but will be read only in runtime mode?
View 3 Replies
Feb 3, 2010
I am relatively new to programming and have managed so far with google and a lot of patience! I am having a problem naming timer contols at runtime. This is what I am trying to achieve.
1. I connect to my dataset and to my first record
2. I create a loop for the recordset
3. I create various objects on a form and name them using the info in the dataset
I also need to create timers and name them using the first field of my dataset. It needs to be dynamic as its database driven. There could be as many as 100 timers at any one point.
[Code]...
View 1 Replies
Dec 20, 2010
I have a form where there's a shape and I'm trying to change the properties of the shape during runtime. For example, you press the Up button and it's supposed to move 30 units up:
[Code]...
View 5 Replies