VS 2010 Adding A Property?
Jan 22, 2011
I have quite a few GroupBoxes and a large number of controls in each. The GroupBox control does not have a changable border color however I found this code on the internet.
Public Class myGroupBox
Inherits GroupBox
Private _borderColor As Color
[code]....
But to add the border to a GroupBox I must put the myGroupBox control in place of each existing GroupBox.Essentially, I there an easy way to give my existing GroupBoxes a border as redesigning my form with the new GroupBoxes is out of the question?
View 4 Replies
ADVERTISEMENT
Apr 25, 2011
I have a class that has a property that I declare like this:
VB.NET
Private _DirectoryList As List(Of FileDirectoryInfo) ''' <summary> ''' Array of directories. ''' </summary> ''' <value>Object</value> ''' <returns>Directory array list</returns> ''' <remarks>N/A</remarks> Public Property Directory As List(Of FileDirectoryInfo) Get Return _DirectoryList End Get Set(ByVal value As List(Of FileDirectoryInfo)) _DirectoryList = value End Set End Property
[Code]...
View 2 Replies
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
Jun 3, 2011
I can add items to a listview this way:[code]But how can I set the Tag property of that same item as the same loop? I tried going ListViewItem.Items (0).Tag = "something"..But that doesn't seem to do the trick. How do I do this?
View 1 Replies
Sep 20, 2010
How can I add a new property to a button or a form or any thing else in the properties window?
Download Genius Web Explorer, It's free.
Download Genius Desktop Clock, It's free.
Download Genius Wallpaper Changer, It's free.
View 2 Replies
Oct 6, 2009
I am trying to add an ArrayList property to a UserControl with the following
Private _hist As ArrayList
Public Property History() As ArrayList
Get
Return _hist
End Get
[Code]...
I get an 'Object reference not set to an instance of an object' error.
View 4 Replies
Jun 14, 2011
I've got this code which basically loops through a set of folders and subfolders and finds specific file types. And then lists these in a listview. Now, it's intended to list exe and msi files. And I've made it so that these icons can be doubleclicked after they have been listed. I do this by adding the path to the file in it's tag property.
But, my superiors want a checkbox next to each item. So that they can check each item they want installed. And then have a button which runs the path in each tag property one at a time. It's basically the part where I fill the listview with the checkbox, filename of the exe or msi file, tag and the icon that I'm wondering about.
This is the existing code. This includes just a Tile view of the listview. Public Sub getDirectories(ByVal strFilepath As String, ByVal strFileExtension As String, ByVal objControl As Object)
'Load first files from the root folder. Then loop each subfolder
Dim di As New DirectoryInfo(strFilepath)
Dim aryFi As IO.FileInfo() = di.GetFiles(strFileExtension, SearchOption.AllDirectories)
[Code]...
But there should be a way of combining these two right? I'm not sure how I can add a checkbox in the first column of the listview? I've already set the Checkbox property of the listview to True. But I could use some pointers here if anyone's got any. :)
View 1 Replies
Oct 10, 2009
I have an imagelist control in a usercontrol I made. I would like to create a property for this usercontrol, to select multiple images (in an 'openfiledialog'), and adding them to the imagelist inside the usercontrol. So, what's the type of this property?
Public Property thelistofimages as [?]
It should be an array of images I guess. And then in the 'set' of the property it would add all the images to the imagelist.
View 5 Replies
Jun 27, 2012
I have seen that BindableAttribute is used to decorate public properties in custom controls. MSDN briefly mentions that it provides the ability to control the binding direction and whether binding is supported at design time.
public class MyControl : Panel
{
[Bindable(BindableSupport.No, BindingDirection.OneWay)]
public string MyString { get; set; }
[code]....
1) I set BindableSupport to No, however I could still do this in markup (.aspx).What does BindableSupport affect then? Does it hide the property in the toolbox?
<cc:MyControl runat="server" MyString="something" />
2) How does one-way binding and two-way binding work in the context of custom controls and ASP.NET?
View 2 Replies
May 4, 2012
I'm adding labels at runtime to my form with a tag. Let's say I have 3 labels with the tags, "1", "2" and "3". I'm adding the tags by counting the labels + 1. When I remove a label with tag "2" from the form there are only 2 left. When I add a new label it will add a new tag "3", but that one already exist. So my "solution" isn't a very good one Although tag "2" is free, I want to give it "4". Any thoughts on how to code this properly?
View 2 Replies
Feb 6, 2012
I am trying to make a deep copy by adding a clone property to my class.
[Code]...
View 1 Replies
Jun 17, 2010
i frequently have troubles with the dock property. it seems that either the order of creation or adding to the parent control determines whether or not a control's dock property supersedes another's. e.g. a control with the dockstyle fill will overlap with another docked control on the same parent. does anyone know what the rules are to determine how docking will behave; particularly in dynamically created GUIs?
View 2 Replies
Apr 2, 2010
I'm looking for a tutorial on how to Adding a list(of Class) or Collection as another Class's Property.What I am after is something like the Columns Collection for the DatagridView control.I would like to add Items in the graphics screen. Where the item list is displayed in the left panel and the selected Item properties are displayed in the right panel.
View 4 Replies
Dec 9, 2011
I'm having some very weird issues with interfaces right now.
I have a very simple setup. In one of my class, I have a Property implementing a Property from an Interface.
In my class it's like:
Private _oForm As IForm
Public Property Form As IForm Implements IContainer.Form
Set(value As IForm)
[Code]...
I have like dozens of interfaces like this working throughout my project and I can't believe this simple one can't work!
View 1 Replies
Apr 24, 2011
I'm getting some data from a database and I'm setting them to a DataGridViewComboBoxCell. I also need to set the Tag property of each DataGridView ComboBoxCell item to a specific value, so later, I can query the DB with those two items.The issue, is that I can't seem to figure out how to access the DataGridViewComboBoxCell Item's Tag property.[code]I wrote it on the spot and it wasn't until later that I realized that I'm setting the Tag property of the DataGridViewComboBoxCell itself and not the DataGridViewComboBoxCell's Items.
View 7 Replies
Sep 27, 2009
I got this warning:
Quote: Warning1'Public Property Address() As Long' is obsolete: 'This property has been deprecated. It is address family dependent. Please use IPAddress.Equals method to perform comparisons. http://go.microsoft.com/fwlink/?linkid=14202'E:\_Visual Studio_2008VBPingerclassPingerpingerbib.vb16738pingerbib
with this
Dim ipaddress As IPAddress
Dim ip As Integer = CInt(Net.IPAddress.Parse(IP_adresse).Address
View 5 Replies
Feb 24, 2011
I'm recreating a program (don't ask - it is embarrassing) in Visual Studio 2005 VB where I read a spreadsheet in an then select values from certian rows. I added the Interop reference and the MS Excel 14 object library, but when I type something like:
Public oSheet as Worksheet
...
x=oSheet.Cells(Row,1).Value.ToString
I'm concerned because when I type the period after the ) it does not allow me to select value. I type it in and it does not give an immediate syntax error but I'm guessing that when I try to run this, it will fail the build. Is there an other reference I need to add or do you get the value of a field differently for Office 2010 than we did for Office 2007?
View 2 Replies
Nov 5, 2010
Do you need 2 values in a Set procedure if you are using a Point as a data type in declaring a property?Because Point has two values the (X, Y) right?
Private Property CurrentPosition As Point
Get
Return m_currentPosition
End Get
[code]....
View 1 Replies
Sep 29, 2011
I am trying to create a property and declare it as a dictionary. This property will be updated and called upon throughout my project. I may be complicating the issue but here is what I have...
vb.net
Private Shared m_ItemName As Dictionary(Of Integer, String)
Public Shared Property ItemName(ByVal Tkey As Integer, Tvalue As String) As Dictionary(Of Integer, String)
Get
[code]....
What I wish to do with the dictionary is to keep a record of the amount of items selected, the Key will be the Integer in the dictionary and will be the ID of that item in a database while the String will be the name of the item matched to that ID in the database.The user will be allowed to enter up to no more than 10 items at a time (overkill but necessary for the unknown).I was originally going to use an array statically declared allowing up to 10 items (eg. Private Shared m_ItemName(,) As String = New String(9,9) {})
View 14 Replies
May 31, 2012
This question is more of a fundamental question then anything.
I've got a custom object collection, lets call it People, that holds my Person class objects. The Person class has a property called Phone Numbers. The Phone Numbers property is a custom object collection of phone numbers that are retrieved from another table. So...
Private People as BindingList(Of Person)
Class Person
Private mName as string
Private mPhoneNumbers as oPhoneNumbers
[Code]....
I'm inclined to go with option #1 because option #2 would make a lot of calls to the database if there are a lot of persons living in New Jersey.
View 3 Replies
Dec 30, 2011
I'm in the process of making a usercontrol and i've run into the problem of how to make a property page. Obviously this makes setting up you control nicer and more importantly to my program makes loading the form faster (setting the properties in the load event vs property page). I was trying to find something to start on but i didn't find a propety page in the "New Item" menu or even something like the "Property Pages" property of a usercontrol in vb6 where i've done this before. How can i make the equivalent of the vb6 property page in vb.net? Maybe with a form or a dialog?
View 6 Replies
Jan 8, 2012
am trying to add an extra optional parameter to a property but it gives this message.Specifiers valid only at the beginning of a declaration. Public ReadOnly Property ReadValue(ByVal Selection As String, ByVal Key As String,Optional Default as string="") As String
View 3 Replies
Jan 22, 2012
I am experimenting with Property info and getting their values etc. The below code gets the properties of a layertable record and creates my PropertyListViewItem
Dim ltr As LayerTableRecord = DirectCast(obj, LayerTableRecord)
For Each prop As PropertyInfo In ltr.[GetType]().GetProperties().OrderBy(Function(p) p.Name)
Try
[Code].....
I have a combo box appear if I click on an item that is not read only. What I want to do is populate that combo box with the values it can accept. ie If it is a boolean, add True and False etc.
View 1 Replies
May 17, 2011
In my class there's an object belonging to Process class. So, in my wrapper class, I need to get the "StartTime" & "EndTime" of the process object. I'm having confusion whether to use a ReadOnly property for this or a function returning the date, in my wrapper class
Is it a good practice to use a function for this purpose or a property ?
[Code]...
View 7 Replies
May 11, 2011
I want to add a serial, so if I want to use my program, I need to enter a serial. Now I already did that, by doing this:
If TextBox1.Text = "Serial2" Then
Form1.Show()
Now, I want to make, Serial2 to only work with one program. So for example, if I give my program to two friends, then I will give them Serial2, I want it to work for one friend only.
View 1 Replies
Mar 8, 2012
In my Installer project I just added my OracleDataAccess.dll to the "Global Assembly ache Folder" folder in the "File System on Target Machine" But when I install my project it doesn't install the OracleDataAccess.dll on the target machine'sC:WindowsAssembly.
View 3 Replies
Oct 25, 2011
i added an exe as reference to another program
Dim oSql As New SqlConnect.oConnect oSql.Show()i need to pass back some variables to the calling program once oSql is closed
View 2 Replies
Sep 28, 2010
I've been researching this all day, it say you must add a record to the datatable if you want to add a new row. This is my code.
Private Sub TagsdetailBindingSource_AddingNew(ByVal sender As Object, ByVal e As System.ComponentModel.AddingNewEventArgs) Handles TagsdetailBindingSource.AddingNew
'Me.TagsdetailBindingSource.CancelEdit()
[code]....
But this code add two rows, the first row has the default data that I entered. The second row doesn't.
I think this is because it add a new row because the "AddingNew" was called. I can't find a way to cancel this "AddingNew". Maybe this code should go somewhere else.
I want the user to be able to use the "Add" button. I just want to insert some default data and then add the row to the grid so they can add another row without having to enter any data.
View 12 Replies
May 26, 2011
I am having a problem adding a row to a dataset.HTML
Private Sub BtnAddNew_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAddNew.Click
nrow = ds.Tables("addressbook").NewRow()
nrow.Item(1) = txtFirstName.Text
nrow.Item(2) = txtSurName.Text
[Code]...
View 2 Replies
Apr 24, 2010
where have all the ToolTip properties gone in this new edition of Visual Basic Express 2010 edition? I know this feature was available in the previous versions of Visual Basic, but in the 2010 Express release I don't see this feature listed any more, did Microsoft rename this, if so what would the new name be?
View 2 Replies