Make Custom Property?

Mar 10, 2009

this is the code for my property

Dim _playernumber As Integer
Property Player() As Integer
Get

[code].....

View 3 Replies


ADVERTISEMENT

How To Make Property Mandatory On Custom User Control

Mar 6, 2012

I have a custom control and would like the properties to be mandatory (not default) when a programmer codes the control. Is there a good way to do this without throwing exceptions in the program?

View 2 Replies

Custom Control With Custom Collection Property?

Jul 11, 2011

I have an ASPX Custom Control which is supposed to load it's properties into an internal collection (defined with PersistenceMode.InnerProperty). Here's the ASPX

<cc:CustomControl runat="server">
<Queries>
<cc:QueryTypeOne ... />

[code]...

View 1 Replies

Property Editor For Custom Property Is Disabled?

Jun 16, 2009

I have a problem with a property on a custom property of a class. Here is the actual code for the inherited form

Public Class Form : Inherits System.Windows.Forms.Form
Private _Active_Application As Custom.Classes.Active_Application = New Custom.Classes.Active_Application
<System.ComponentModel.EditorBrowsable(ComponentModel.EditorBrowsableState.Always)> _
Public Property Active_Application() As Custom.Active_Application

[code]....

but when i use a separate class to inherit the above class this property ('Active_Application', not Custom.Classes.Active_Applicaton) is disabled.

View 1 Replies

Make Stand Alone, Custom Web Browser (with Custom Errors, Or Generic)

Dec 13, 2011

Cookies to be stored in folder and on close delete the cookies The ability to watch youtube vids, view images, and play js/flash games good security, no ads?

View 6 Replies

.net - Make A Class Property Behave Like The Checked Property On RadioButton?

Jun 1, 2012

I have a very simple class that holds a few public properties - ID, Text, Colour, etc. and a Boolean called 'SelectedItem'. Just like the Checked property on RadioButtons, only one item can have its SelectedItem property set to True within a particular group. Note: there will be several separate groups (lists), each allowed to have only one item with SelectedItem = True.

My first thought was that I would probably just have to handle everything outside of the class, setting SelectedItem to False for every other item in a particular list when another item was selected. But that seems rather inelegant to me. So I've been trying to think of how this might be done within the class. For example: could I perhaps have a private string property called say "GroupName" - set in the New sub when adding a new instance of the class - and then use a private shared method to set every item's SelectedItem property to False, provided the item has the same GroupName as the newly selected item? I would have a go at doing this but I have no idea how to enumerate every instance of a class from within that class, or whether that's even possible. Is it? Or is there another (better) way to achieve my goal? Here is a cut-down version of what I've got so far:

Public Class ResourceItem
Public ID As Integer
Public Text As String[code]....

As can be seen: instead of instantiating a new ResourceItem and passing that as an argument to the manager's Add procedure, I'm simply passing the details of the new item and the procedure is creating the item from those. I don't know whether this is a good or bad idea - please advise - but I've done it because I couldn't figure out how to make the SelectedItem property only writeable by the manager, so I wanted to avoid having directly accessible objects that could have their SelectedItem property set to True without it deselecting all the other items in the same group. Of course that still leaves the possibility of setting a variable to one of the manager's list items and setting it from there, so I would still like to know how I could prevent that, if possible.

UPDATE: I didn't use the code above in the end, deciding instead to go with Cyborgx37's solution - which seems to work perfectly well for me despite the warnings about best practice. I also realised I would need to use the same class in another scenario where multiple items could be selected, so it was easy to add a Boolean property to the manager to enable that.

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

.NET Custom Property Attribute?

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

Add A Custom Property Trigger?

Dec 21, 2009

I am using Expresion Blend 3 and created a new user control in my project. I want a storyboard to run if a custom property of that user control is triggered like with the ones shown here in the list..

I learnt you need a dependency property, but my understanding there is limited. Here's the basic code I set up with property "IsAwesome" as an example[code]...

View 1 Replies

Add Property To Custom Control?

Apr 3, 2010

I have created a custom class, which contains a panel and a label on it. I added to this class a pcaption property, which holds the label text. This property is browsable and I can change its value.But when I drag the custom control to the form and change the pcaption property, it has no effect. Even the <Defaultvalue> has no effect. Why?

Here is the class code:

Imports System.ComponentModel
Public Class mypanel
Inherits Windows.Forms.Panel
Private panelcaption As String

[code]....

Color values are unimportant, you can change it.

View 3 Replies

Can't Access Custom Property?

May 15, 2010

I created a new DataGridViewColumn type called DataGridViewGradeColumn.

Public Class DataGridViewGradeColumn
Inherits DataGridViewTextBoxColumn
Public Property AssignmentName As String

[code].....

View 1 Replies

How To Get Custom Property Of Form From Another One

May 11, 2010

I have two forms, say Form1, Form2
Form1 has one textbox and one button, Btn1 when clicked, it opens Form2 as dialog.
Form2 has one textbox and one button too.
First I click on Btn1 to open Form2 as dialog. And when I click on Btn2 on Form2, I want the text in the Textbox2 to be copied to TextBox1. I know it could be done by Public Property Get, Set but I am stuck.

View 7 Replies

Add Property For Custom Control In VS2008

Jul 2, 2009

I am developing a custom control with VB9, and I want to add a Property Name TextFileName this property need to use OpenFileDialog, which type I can use when I define this property?

for example another property I use is EnterFocusColor and its type is System.Drawing.Color so when the user select the property it opens the ColorSelectionDialog Hany M. El Tarhony

View 1 Replies

Add Validate To A Custom Class Property

Mar 20, 2011

I'm trying to add validation to one of my class properties:[code]The value for the golfer's handicap comes from a oombo box on the form. Even if I have nothing set for this property at runtime, my validation doesn't work. I tried putting the If statement under Get instead of Set, and tried mHandicap = value after an Else in the If statement, but nothing seems to work. I'm working in the dark here and can't find anything suitable online. I was hoping to not go down the path of ReadOnly or WriteOnly properties as I'm not at that stage yet, but does this make a difference for my purposes here? Can anyone guide me as to what I'd need to do from this point? If I've got it right, you can add validation in the class and this means that you then don't need to repeat this validation in the form??

View 3 Replies

Assign Property To Custom Control (WPF)?

Jun 21, 2010

I have created a CustonControl (NOT a usercontrol) and defined a DependencyProperty as following

[code]...

View 1 Replies

C# - Create An Extended (custom) Property With EWS?

Aug 17, 2010

I have created a little demo application which is able to create a meeting request by using the Exchange WebService (EWS). I would also like to add some custom properties to this item but up to now I have only found examples which use the Exchange Managed API, which I won't use. There must be a way to create these properties by only using EWS... Does anybody know how and can provide a little code example?

View 1 Replies

Color Property On Custom Attribute?

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

Custom Control Image Property?

Apr 13, 2012

I'm trying use just a user control form to act like the old VB6 picturebox. Mainly, i'm doing this is because a user control form is also a container but i also want it to have an image property. I've done this. The new control does have an Image property but the problem is that the user control form doesn't have an image property but only a BackgroundImage property.I was hoping that there is some way to place the selected image, directly on the surface of the user control and not to it's BackgroundImage property. Here is what is got so far:

Code:
Public Property Image As System.Drawing.Image
Get
Return Me.BackgroundImage
End Get

[code]....

As you can see, for now, i have to use the BackgroundImage property but i want to image to be placed on the controls surface, so that the image can be manipulated, like drawing game tiles on it or image processing. The user control doesn't have a real image property?

View 11 Replies

Dynamic Custom Class Property

Dec 18, 2009

I have a For Each block loops through a list of objects, the objects are all instances of a single custom class I have made which has multiple properties.The logic used in this block uses a property of the custom class to do a set action, is it possible to dynamically supply which property it uses in the logic? This will be more efficient and prevent me from having to create this logic over for each property of the custom class.My best guess was that maybe it is possible with reflection, however my searches into reflection have left me more confused.

View 2 Replies

Property Group In Custom Control?

Apr 8, 2012

What I want is a property that like Font property, it has "Name", "Size", "Unit", "Bold" and the other property in it. I tried the solution in the post I tried the solution like this:

<TypeConverter(GetType(ExpandableObjectConverter))> _
Class TestingClass
'Some property here

[code]....

View 1 Replies

Return The Value Of A Property In A Custom Class?

Jun 8, 2011

I have a custom class named Location with multiple properties.

[Code]....

How can I get the value of each p.Name and return "Main St", "AnyTown" o "USA"

View 1 Replies

VS 2005 Specifying Custom Property Editor?

Nov 10, 2010

We have a Windows.Forms.PropertyGrid control that we use to edit application settings. We expose the application settings through a class, giving each setting attributes to control the appearance. An example property definition is shown below:

<DisplayName("Snap Tolerance"), _
Category("Tolerances"), _
Description("The distance (in Points - 1/72"") to be searched for snap points.")> _

[code].....

View 1 Replies

Custom Class Property To Lower Case

Jun 3, 2010

I am trying to create a settings class.The Property Test() is a list of strings.When I add a string such as: t.test.Add("asasasAAAAA")I want it to autmatically turn lowercase. using t.test.Add(("asasasAAAAA").ToLower) will not work for what I need. [code]

View 2 Replies

Custom Control Property Load Order

Aug 9, 2010

I've created a custom control in VB.NET on .Net 3.5, in VS2008, which contains a load of custom properties, including RSS feed address, proxy address and proxy port.This control is an RSS ticker, which works really nicely, but doesn't initially run at all, and from stepping through my code, this is because none of my properties are being passed data from the containing form, until after the control has been initialised, and the code behind the control has run. The code (relevant bits) looks as follows:[code]

View 2 Replies

Custom Control Property Persistence During Runtime

Aug 30, 2011

How to get a property to persist after its been changed dynamically during run-time? When Visual Basic reverts back to the IDE, the property goes right back to its original value.

View 3 Replies

Custom Control Property With DropDown Values

Jun 21, 2010

I have a custom control. I need to add a property, say, Comparison, to the control. The property should be set at design time using a dropdown. The Dropdown will have String values like '=','>','<' etc.
I tried using Enum values and working perfectly but I need to do some extra coding to convert the Enum values to the string I required. It would be great if I can get the values from the dropdown so that I can directly use the selcted value.

View 2 Replies

Custom Function For Datacolumn.expression Property

Jan 23, 2009

i read an article about datacolumn.expression property here [URL]. this is really great. but i was just wondering, for my case i want to use my custom function to use in the expression. basically, on my datatable i added an unbound column AGE. when i display records, i just want the age textbox to be populated with the computation of the person's age based on birthdate.

View 7 Replies

Custom Graphic Control Enum Property

Aug 28, 2008

I am creating a custom graphic control and I'm stuck. I have three classes -
Protected Class ControlBase' Handles common properties and onpaintPublic Class ImageControl Inherits ControlBase' handles Image propertiesPublic Class TextControl Inherits ControlBase' handles Graphic Text properties
I also have a private enum ControlType and Public property for that enum. My goal is to have either a TextControl or a ImageControl created based on the ControlType. Since this property is outside of those two classes and the base - where do I put this property and how do I call up the correct class?

View 1 Replies

Databinding A Custom Property On An Inherited Control?

Apr 26, 2012

I am creating an Extended DateTime picker. I have created a Class the inherits the Default DateTimePicker and Adds a new Property NullableValue. I have placed the control on a form and bound it to a Binding Source using the NullableValue Property. When I load the record the control updates as it should. But when I change the value and save it does not save back to the database.

[Code]...

View 1 Replies

How To Set Description Of A Property In Custom Server Control

Sep 2, 2009

I have created a custom Server Control and I want to add a description to the properties and events that the control holds. I have looked over the Internet and came up with the following.[code]Unfortunately this does not seem to work in visual studio .net 2008.

View 1 Replies







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