VS 2008 PropertyGrid And Dynamic Enum From DB
May 26, 2010
We are using the .NET PropertGrid to edit the Usersettings of our application. If we use Strings or integers than it works perfectly. Now we need a propery, we call them "Vendor", that store a GUID of the Vendor from a database. But the user didn?t see the GUID in the PG. he can choose beetwen the venders Names in a combobox. This combobox must be loaded from the database I have start to try to solve that with following
[Code]....
View 2 Replies
ADVERTISEMENT
Dec 30, 2009
I have a URL lets say . some time i need to send HTTP and some time i need to send it to HTTPS for that i created a enum:
Private _protocol As Protocol
Enum Protocol
HTTP
HTTPS
[CODE]...
Now when i get value back from protocoltype it returns me integer value as enum do so tell me how to get string from enum or other substitute.
Dim targetUri As String = setting.protocolType & "://www.mysite.com"
View 1 Replies
Mar 25, 2011
I'm trying to declare an enumeration and one of the names I'd like to use for an item is not usable apparently. Where I am declaring 'STEP = 3', I get this error message in visual studio: "Statement cannot appear within an Enum body. End of statement expected." Is it possible to use STEP as an item name somehow? [Code]
View 4 Replies
Jan 13, 2011
how can i selectively disable propertygrid items, or even categories based on the value of another property? i read somewhere about a typedescriptor but i couldn't find a good example.
View 6 Replies
Jan 2, 2012
RE - FilesystemRights Enum
This Code:
Dim FSRS As Type = GetType(FileSystemRights)
For Each fsr As String In [Enum].GetNames(FSRS)
TextBox1.AppendText(fsr.ToString & vbCrLf)
Next
View 3 Replies
Apr 17, 2009
I am using VB.NET 2008. I am using propertygrid and have added a few elements. I have 3-4 categories and wanted to know how can I expand/collapse a particular category thru code. I did find a code on net but it didn't work.
View 10 Replies
Aug 12, 2010
I have a custom control and have created some properties for it.When I click on that control, its properties are then shown in the PropertyGrid.The problem, is that I only want to show some of the predefined properties as well as my custom properties.Does anyone know how I can filter out the properties I want shown?
View 9 Replies
Oct 7, 2009
I'm trying to add a custom DropDown to the PropertyGrid for a control. I am adding the TrackBar control. It works fine, except, I would like to have the values updated in the PropertyGrid as I move the TrackBar. As it is now, it only updates the PropertyGrid when I finish and click off the TrackBar... I know the problem lies in the Type Editor. How can I get it to allow interim values to be processed. Is there some callback function I can use?
Here is the Type Converter code:
Imports System.Windows.Forms.Design
Public Class Slider
Private editorService As IWindowsFormsEditorService
[code]....
View 2 Replies
Oct 21, 2009
1 - Need to create a kind of composite property, like the font property, that it's showed with a plus sign to expand. For example i need to define a new pen, i need to define the color and the width... 2 - I need to define the color for one brush, but if i create a property of the type brush in the PropertyGrid it appears like "System.Drawing.SolidBrush"
View 2 Replies
Sep 11, 2009
I have a class that inherits from control with some custom properties added, and I am using a propertygrid to change the properties at run time. I don't want any of the inherited properties of the control available in the PG so to each of my class properties I amassigning a CategoryAttribute and I am adding the same categories to the PG.BrowsableAttributes collection. When I add a single category to the BrowsableAttributes collection it works fine, but when I add more than one, none of the categories show up in the PG. I am wonding if there is a simple setting in the PG, or if I have missed something setting it all up.
[Code]...
View 2 Replies
Jul 6, 2009
Does anyone know of a way have the PropertyGrid control display a NumericUpDown instead of a DropDown box or text box? One of the properties that I need to capture is an integer and I'd like the user to be able to spin up or down to choose a value instead of typing it in.
View 1 Replies
May 26, 2010
Which is better, using a nullable enum or adding the value None=0 to your enum list?Using nullables requires more code, but I kind of like it since it forces me to think about the possibility. Otherwise I'm liable to forget about the None enum and fail to account for it being a special case.
View 11 Replies
Aug 23, 2011
I've tried the code below but it always returns nothing, It should enter
Protected Function GetTotalDebitAmount(ByRef roEntryDetailRecordBaseList As List(Of PPDEntryDetailRecord)) As String
Dim iTotal As Integer = 0
[Code]....
I need some one who evaluate the part below:
If CBool(Array.IndexOf([Enum].GetValues(GetType(TransactionCodes.Debits)), CInt(oEntryDetailRecord.TransactionCode)) > 0) Then
View 1 Replies
May 24, 2010
I need to represent the following query using LINQ:
DECLARE @PurchasedInventoryItemID Int = 2
DECLARE @PurchasedInventorySectionID Int = 0
DECLARE @PurchasedInventoryItem_PurchasingCategoryID Int = 3
DECLARE @PurchasedInventorySection_PurchasingCategoryID Int = 0
[code]....
Now, I know that a query in .NET doesnt look like this, this is my test in the SQL Design Studio. Naturally VB.NET variables will be used in place of the SQL local variables.My problem is this: All of the conditions after "WHERE" are optional. In that a query might be made that uses one, some, all, or none of the conditions. V.PropertyID and V.Value can also appear any number of times.In VB.NET I can make this query easy enough by simply concatenating strings, and using a loop to append the "V.PropertyID/V.Value" conditions.I can also make a Stored Procedure in MS SQL, which is easy enough.However, I want to accomplish this using LINQ.
View 2 Replies
Feb 19, 2010
Ive managed to dynamically create a form, and dynamically create a timer, but i have not been able to create the timer on the dynamic form. Specifically, i need to be able to have the timer itself create another form with a timer. (I realize that this would create a new form every interval on the timer, that is what i want to do)
1. A way to add the timer to the dynamic form, and maintain the timer sub on my main form.
2. A way to create the whole thing over (dynamic form and timer) through the previous dynamic form and timer.
I was thinking i could use a collection/array to store the forms and timers, but i'm still having trouble figuring out how to add entire forms or timers into a list. (A timer is not considered a control, so i cant use a controlcollection...)
Heres my code;
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim frm As New Form
[Code]....
*EDIT* Btw, my idea was to use i as a variable that increases every time a form is created, then insert the form into the array, with i as the integer. i just need to know how to create a new form with a different name each time. (as with timers)
View 1 Replies
Feb 4, 2009
I am coding in vb.net. I want to achieve something like this (sample) -
Structure Transport
Dim land as L
Dim Air as A
[CODE]...
But though i can create enum but how can I embedd it in structure. It is not allowing me to do that.
View 2 Replies
Sep 2, 2010
I have an Enum file, as shown in first code block. Though it's first time I use an enum file, so maybe it's not correct to use it like this.. My purpose is just to be able to reference a global parameter from anywhere, so I can just type DataInterval.M1, and it will be treated as an integer... or.. will it not ? urther I have a property in my DataSeries class, of type DataInterval. And in this class I also have a bunch of methods Get/Set etc. to do different work on the dataseries (Inherits List(Of BarData)). roblem: The interval property keeps changing unexpectedly every time the GetNextCloseTime function is called.
''' <summary>
''' "Time Frame" of data series
''' </summary>
[code].....
View 5 Replies
Mar 28, 2010
I've found the ability to make meaningful Intellisense-enabled comments on my functions and sub routines absolutely priceless.
I'm wondering if I can do the same when an Enum is defined. I'd like for each Enum highlighted in the drop list to have some information associated with it. Can that be done?
View 3 Replies
Jul 28, 2011
In a global module, I define a new type that can take 4 values:
enum tAction as integer
None
Update
Insert
Delete
end enum
A use this type in many places in my code to check the value stored in a variable (if MyAction = tAction.Delete then ...)
In a separate file, I define a class. One of the properties should return a value of this type:
public class XXX
private _Action as tAction
public property ClassAction() as tAction
[Code].....
This way I could check a class property in the same manner (if MyClass.ClassAction = tAction.Insert then ...)
However I get a syntax error in the property definition: 'ClassAction' cannot expose type 'Globals.tAction' outside the project through class 'XXX'
My entire program consists in a few modules, in a single project. How can I use my tAction definition in my classes?
View 4 Replies
Dec 7, 2010
Application: Arrays are to be used for this. When button Add Student is clicked it should add all the information for a student and when Show Student button is clicked it should prompt the user for student's last name and student's information in a message box. Class ranking list box has an enum function to it and has to be stored be show along side other answers.NOTE: FindItemIndex if from the last application I did, i am suppose to use it in this one,so you can modify it the way you want.
[code]...
View 3 Replies
Jul 12, 2009
I've got this in a public module
Module PublicModule
Public caseBAL_C As caseBAL
Public clientBAL_C As clientBal
Public Enum CSFlags
[Code]...
It doesn't like the Public Property StateFlag() As CSFlags -it's saying that CSFlags
'StateFlag' cannot expose type 'PublicModule.CSFlags' outside the project through class 'caseBAL'.
View 2 Replies
Jan 28, 2010
I have an enum set with custom attributes. need to retrieve the attribute value in single statement ...
Public Enum Messages
''' <summary>
''' <value>(MessageText : Do you want to save ?)</value>
''' </summary>
<StringValue("Do you want to save ?")> Save
[Code] .....
Now I needed to retrieve the enum value like something below.
Messages.Save.GetType().GetCustomAttributes...... something is possible in single statement itself?
View 1 Replies
Dec 2, 2010
How to add my explanation to auto finish in user classes or enum etc?
View 3 Replies
Jan 29, 2011
I'm trying to pass data from the main form to a business class form for calculation.I have 3 types of cars and I can't get the code right to pass that to the business form. It seems correct to me, but obviously, it's not.This is the code for the calculate button, I can't figure out why its telling me that CarSize is not a member of the business form when I have it in the Enum statement at the top. I'm going by what the book says and this appears right according to it.
Dim CarTypeInteger As Integer
'determine the car size from radio buttons
If LuxuryRadioButton.Checked Then
[code]....
In the book it says to specify the class name when declaring the enum on the business form. So to me it looks like it should be -RentalRate.CarSize.Luxury The error I have is 'CarSize' is not a member of the 'ChristiansCarRentals.RentalRate'.
View 6 Replies
Feb 12, 2011
I need to create kind of a menu in my application in wich I have to set different parameters before I populate a Datagridview with some values.So, the idea is to use a PropertyGris in which from which I can edit some parameters and after that I run a query (with parameters setted by PropertyGrid) tu populate my DGV.For example I create some properties like NAME OF A PROJECT, ID OF PROJECT, RESPONSABLE, etc and I put this properties in a propertyGrid and than the user can interact with the propertyGrid and set value for each parameter, bfore running the query for populating
View 3 Replies
Apr 9, 2010
i'm hoping to use a propertygrid in one of my programs.
1/ i'm having difficulty writing a (text) property that will open a multiline editor like the textbox text property in the vb properties window. how would i do that?
2/ i need a way to make either selected properties or preferably entire categories disabled or enabled at runtime.
3/ how can i turn off automatic sorting so my categories + the items they contain are displayed in the order they are in my class?
Imports System.ComponentModel
Imports System.Drawing.Design
Imports System.Text.RegularExpressions
[code]....
View 23 Replies
Mar 15, 2012
I want to add a new PropertyGrid control every time an item is added to a ListBox.I have a ListBox, with an "Add Item" button underneath (and also a "Remove Item" button). Every time an item is added to the list, I want to create a new PropertyGrid corresponding to each item. The relevent PropertyGrid should appear when an item is selected in the ListBox, and the user can edit the properties of that item.
The only way I can think of doing this is by creating a dynamic array which has length ListBox1.items.count, but I'm not sure it's possible to create an array of controls.
View 15 Replies
May 15, 2009
How to dynamically add Datasource Property in propertygrid in vb.net?
View 1 Replies
Feb 11, 2010
PropertyGrid is only scrollig correctly when I place it on a Windows Form, but does not work when it's docked in a SplitContainer Panel. Only the vertical scroll bar is needed for my application. The vertical scroll bar displays correcly and you can move it up and down okay, but the contents of the PropertyGrid (while correct) do not scroll up and down with it. I'm using Visual Studio 2005 Professional Version 8 with .NET Framework 2.0 and coding in Visual Basic. Has anyone found a way around this?
View 1 Replies
Jun 16, 2009
In my propertygrid having one custom property ..suppose some text is there in this item.i want user to allow only delete the item.nothing more like editing ,backspace nothing..only provide delete key option to this property item..
View 4 Replies