Getting Used To The New Listbox Property?
Aug 19, 2009
Im in Vb.net and it took a little getting used to the new listbox property, but I got it now. I am storing self created objects that contain a key and a string. THe problem is that the key is not sorting,
The values are something like
3E-1
3E-11
3E-12
3E-2
I have tried putting it into an arraylist first, then sorting, but same order. Any ideas??
thks
View 6 Replies
ADVERTISEMENT
Apr 1, 2009
Which ListBox property do I use to get the ListBox on my form to show the desiredCollection item?
Dim i As Integer
i = 9
lbxBiz_Mon_Start.Items.IndexOf(i)
[code].....
View 4 Replies
Jun 14, 2012
I have a form with a dropdownbox two listboxes and two buttons on it. I removed a "select" button as I just used the DropDownList1_SelectedIndexChanged, but the event would not fire until I used the suggestion from:Why DropDownList.SelectedIndexChanged event does not fire?
It involved changing the AutoPostBack='true' and EnableViewState="true" properties
So now the DropDownList works but with the two listboxes, the SelectedIndex stays as -1 and does not change even when selected.
[Code]...
I think it has something to do with post backs, page_load or the selectedindex changed event of the listbox, it worked perfectly before I made the modifications.
View 1 Replies
Jul 23, 2010
I have this code for an ownerdrawn list box that is repainting too frequently. It seems to be related to trying to scroll an event with a different height than normal. Here is the 'smallest code to reproduce the problem' that can be pasted into a blank form (erase the designer file) - VB version (c# of course does the same thing):
[Code]...
View 3 Replies
Jun 23, 2010
I have been trying to create a custom control based on the ListBox called FileListBox. I followed Microsoft's walkthrough but am having some trouble.
What I want is to add another property to the ListBox called SafeItems which is an ObjectCollection of strings (like the Items property). I will use the Items property to store a collection of Filenames as strings and I would like to store the corresponding SafeFilenames in the SafeItems collection.
This is what I've tried:
FileListBox.Designer.vb
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class FileListBox
Inherits System.Windows.Forms.ListBox
[Code].....
View 6 Replies
Mar 4, 2010
I am not so good at VB.NET, well, I am working with a school to run a Spelling Bee aimed at children in year 7. And to make it fair and unbiased i need an application that can choose randomise a word from the list box then transfer the string to the text box. So basically something that can pick a random string from the listbox and show it in the textbox1.text property.
View 4 Replies
Apr 21, 2009
I am a student in a Visual Basic class. We were working on a project using the Count property of the ListBox. I'm using Visual Studio Professional Edition 2008. When I enter a line in the editor that looks something like this: If lstResults.Items.Co
IntelliSense will generate a little balloon that says 'Public ReadOnly Property Count() I saw the () after Count and thought that meant that was the proper way to code it. So that is what I did. The code seems to work with ...Count() or just ...Count. I was wondering if there is some reason why the parens show up after the description of the Property in IntelliSense.
View 3 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
Nov 19, 2009
If I set a ListBox.Height = ListBox.PreferredHeight when the control is hidden and IntegralHeight = True, then set it visible:
a) Actual Height reduces by typically 3-5 pixels after redraw (but not 1 pixel per item).
b) PreferredHeight does not not appear to give the correct integral of item heights.
Is there a way to make ListBox calculate the correct integral Height before the ListBox is made visible, so it can be correctly pre-positioned from bottom edge?
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
ListBox1.Visible = False
ListBox1.IntegralHeight = True
[CODE]...
View 4 Replies
Feb 17, 2011
This code bellow to compile a single listBox on form1 to listBox on form2 then listBox on form3.
I want to modified this code to compile 169 of ListBoxs on form1 to 169 listboxs on form2
and 169 listBoxs on form3.Try this code,not need the new coding.
Original code from JoOl and modified by John Anthony oliver
[Code]...
View 1 Replies
Feb 13, 2010
1 when my listbox returns resaults it only brings back 10 how do I set it to return lets say 500
and question 2 is when I click on my links in listbox it's not opening webpage as I would expect it...
This is my code
[Code]...
View 8 Replies
Jun 10, 2011
Is there a way for implementers of an interface where a ReadOnly property is defined to make it a complete Read/Write Property ?
Imagine I define an interface to provide a ReadOnly Property (i.e., just a getter for a given value) :
Interface SomeInterface
'the interface only say that implementers must provide a value for reading
ReadOnly Property PublicProperty As String
End Interface
This means implementers must commit to providing a value. But I would like a given implementer to also allow setting that value. In my head, this would mean providing the Property's setter as part of the implementation, doing something like this :
Public Property PublicProperty As String Implements SomeInterface.PublicProperty
Get
Return _myProperty
[code]....
View 5 Replies
Aug 27, 2009
I searched on the forum / Internet for the solution how a PropetryInfo object (of a Public property) can reveal if it has a Private Protected Setter ... it was all in vain .... all help I found was about how to "Set" value of a public property having a Private Setter.I would like to know if I have a PropertyInfo object of a public property, how would I know if its Setter is Non Public?
I tried, in a exception handling block, where I did a GetValue of the PropertyInfo object and then called SetValue by setting the same value back... but to my surprise it worked well and didn error out.
[Code]...
View 1 Replies
Jun 20, 2012
I'm having a few problems converting some code into VB.NET from C#. Most of the translating is done, but I am getting errors when I try to run my code, and I can't figure out what is causing them. Here is the Sub I translated.
Public Sub CreateWidget()
Dim blue As LCDColor
blue.Red = 0
blue.Green = 0
[code]....
The error I receive on this line ("vision.Widgets.CreateWidget(wg1)") reads "In order to evaluate an indexed property, the property must be qualified and the arguments must be explicitly supplied by the user."
View 11 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
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
Nov 14, 2011
Using the following code I get Identifier expected and Property access must assign property or use its value errors:
ViewState["SomeKeyValue"]
What is wrong with this code?
View 2 Replies
Aug 3, 2010
I have a dataview an i would like to show the count property in a text box.
i tryied the following
me.textbox1.DataBindings.add(new DataBindind("Text",DataView,"Count"))
But i have a exception.
View 10 Replies
Nov 27, 2010
I have a listbox binded to a list of objects. For each list item I wanted to have a rectangle whose fill color is determined by a few properties of the binded object. So I did the following:
Made sure INotifyPropertyChanged was implemented on my object.Created a class to expose the properties I am interested in as attached properties.Binded the properties of the object to the attached properties of the rectangle Created a style that uses triggers to set the rectangle fill based on attached properties.
This works, but only the first time the property of the object changes. After that, the attached properties do not seem to be receiving notification when the data object's property changes. I have double checked and my data object is raising the INotifyPropertyChanged event.
<Rectangle Style="{StaticResource RecordStateRectangleStyle}"
Width="10" Height="10" Stroke="Black"
local:RecordAttachment.RecordState="{Binding Path=RecordState}"
local:RecordAttachment.IsDeleted="{Binding Path=IsDeleted}" />
[code]....
View 1 Replies
Sep 1, 2011
I have a weird question and I honestly hope you understand what is happening here: I design my form (using VB.NET) and put on it a few textboxes, comboboxes and a listview. After the design, I want to adjust the TabIndexes for each control on the form. On the right-hand side of the interface is the property box.
I then select the 'TabIndex' property item and enter a number key (for instance 0) for that selected item. I then select the next textbox control and enter the next number (for instance 1) WITHOUT re-selecting the 'TabIndex' property item. As soon as I select the combobox or listview control, the currently selected property item jumps to 'Items' or 'Collections' and does NOT remain on the 'TabIndex' property item. Why is this happening? Everything worked fine and all of a sudden this starts happening. Should I reset the editor settings or how can I resolve this matter?
View 1 Replies
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
Jun 6, 2009
I receive a System.Data.SqlClient.SqlException in the following code: Specifically Incorrect syntax near ' In order to evaluate an indexed property, the property must be qualified and the arguments must be explicitly supplied by the user. The exception detail in its entirety is shown below the code.
[Code]...
View 5 Replies
Jan 15, 2010
on a Windows Form, an object myObject is bound to myObjectDataBindingSource like this:myObjectDataBindingSource .DatSource = myObject on the form, i have a check box bound to the property: chkProp1 for example of the object: myObjectDataBindingSource In the code when the checkbox is clicked, I need to go in code and change another text property of the object txtProper2 for example like this:
Private Sub chkProp1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkProp1.CheckedChanged
[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
Nov 5, 2011
when I'm creating a new property in Visual Basic .NET in Visual Studio 2010, the rest of the Property (template?) doesn't complete the basic framework of the property in the code editor. It is now treating a statement like:
Public Property Length() As Integer
Instead of completing the property as it used to (code follows), it simply goes to the next line:
Public Property Length() As Integer
Get[code].....
What happens now is that, if I type in the 'End Property' code, the name of the property will now be highlighted as an error since it doesn't have a 'Get' or 'Set' portion.However, when I THEN type the 'Get' on the line following the 'Public Property Length() As Integer', then the balance of the property is created in the code automatically.I don't know how this got changed, but would love to change it back.Does anyone know if there's a setting in VS2010 that addresses this, or if it's something with the basic templates that visual studio uses for creating the basic code components?The weird thing is that for everything else, from class declarations, structures, functions and subs, the IDE still creates the balance of the code structure correctly. The only area where it doesn't is for Property declarations.
View 2 Replies
Sep 20, 2010
This code snippet was converted from the c# snippet on this link A ChildWindow management service for MVVM applications There are two classes in this snippet first is my confirmessage class
[Code]...
Now this works fine in C# , however in vb,net the line where I add the event handler generates the following error on the message.callback property : Property access must assign to the property or use its value I am tearing out my hair on this I have never used the Action of T delegate before so could i be missing something simeple ? I can provide the c# code as well.
View 8 Replies
Oct 29, 2009
Property Grid - Open a dialog box to edit a property?
View 1 Replies
Mar 3, 2011
So I'm just trying to understand why someone would want to use the shorthand property instantiation
Public Property CarModel As String <-- property
As opposed to
Public CarModel As String <-- variable
View 19 Replies
Nov 18, 2009
I want to type the characters from right to left (to behave as a right alignment). But I am not supposed to use the Right Alignment property or the RighttoLeft property of a text box.For example, I want to enter the characters of a string from right and each character should shift one space left so that the user can enter another character after that.
View 13 Replies
Aug 13, 2011
got an ErrorProperty access must assign to the property or use its value.Here i attach the code which have an error.In this program i tried to add data into form . I also create button , textbox. i am using visual studio 2005 and sql 2005. i also have attach the imagece
Private Sub btnregister_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnregister.Click
admin1.LoginDataSet.staff(Me.NAMETextBox.Text, Me.TELEPHONEMaskedTextBox.Text,
[code].....
View 7 Replies