VS 2008 Adding Only Distinct Classes To Listbox
Apr 23, 2009I have a List(Of SomeClass) containing a number of SomeClass items. SomeClass is just a small class with two properties, a Name string and an Int integer:
[Code]....
I have a List(Of SomeClass) containing a number of SomeClass items. SomeClass is just a small class with two properties, a Name string and an Int integer:
[Code]....
I am trying to distinct on multiple columns and get datarows from datatable. but getting error.
Dim query As IEnumerable(Of DataRow) =
(From row As DataRow In SourceTable.AsEnumerable() _
Select row.Field(Of String)("ColumnName1"),
[Code]....
I want another datatable with distinct row based on given columns from SourceTable.
I am currently working on some tools and I am having some troubles adding new lines in a listbox.
vb.net
For i = 0 To lstFiles.Items.Count - 1
Process.Start("C:UT2004Systemucc.exe", "compress " & lstFiles.Items.Item(i))
If IO.File.Exists(lstFiles.Items.Item(i) & ".uz2") Then
[Code].....
The meaning of this code is that if the file exists, it will add a new line called Success below the dragged fileline. If the file doesn't exist it will create a new line called Fail below the dragged fileline.
have another problem trying to solve again I am trying to add a line into a listbox in this format time item (10), so, e.g. 4:00 Item1(10) So when the next item is added into the listbox and so on, it will look something like this
4:00 Item1 (10)
4:10 Item2 (15)
4:25 Item3 (20)
The time is a Date, and the minutes to add on is extracted with regex. I was able to add the items like above with hardcoding but ain't successful when i try to do it in a shorter way.
[Code]...
Is it possible to define operators like addition, subtraction and such to classes? I'm trying to convert a vector class from C++
class CVector2
{
public:
float x, y
[Code].....
is there anyway we could extend a shared function for a class? example:
<Extension()> Public Shared Function GetName(ByRef e As [Enum], ByVal value As Object) As String
Return [Enum].GetName(e.GetType, value)
[Code].....
however i dun hav a choice as Extension methods can be declared only within modules
Is it possible to have visual studio 2010 automatically add namespaces to classes within folders just like c#?
View 1 RepliesI will attach a pic of the errors I have left to resolve. And in addition, when I run it, it doesn't put the CustName and AcctNo in the ListBox. I could attach more code to get a bigger picture of what I'm trying to do. Here is where I have the errors on the list:
[Code]...
I got a combobox that I populate with items by using databinding options which works fine, but what if I only want to only select the distinct items, was trying to do that but no avail so far. if I could do that just by using an sqladapter in code but is that what I should really do ?
View 2 Replies1 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]...
I need to add integers in a listbox, using for next.
Dim intCount As Integer
Dim dblTotal As Double
' here are the lines of code that will perform the calculations
' to create a grand total.
For intCount = 1 To lstCosts.Items.Count
dblTotal += dblSubTotal += intCount
Next intCount
lblTotal.Text = dblTotal.ToString("C")
The amount of items in the list box is not seso I used the items.count. I have been getting the wrong result.
Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click
' Declarations.
Dim intCount As Integer
Dim dblTotal As Double
' here are the lines of code that will perform the calculations to create a grand total.
[Code] .....
i have listbox and i want to add three fields first name, middle name ,last name from customer details table to the listbox
View 1 Repliesin this : I have a button (ADD), a TextBox & a ListBox. Here's what I want, when I write words in TextBox and when I click on Button ADD, it is saved & added in List1
View 1 Replies..i am working in my project i am having problem in the list box part.. .
[Code]....
I want to check if an items exists on my pseudo random listbox before adding a newone if the number already exists i need to know before duplicating it.
View 10 Repliesevery time i select an item from the listbox (just 1 at a time), it'll add that item's price to the total. but for some reason it's not doing it. can someone check out my code and see what's wrong with it? i'm getting the item price as the total (what I want it to do is add onto the total)
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim total, grandtotal As Decimal
If lbSelect.SelectedIndex = 0 Then
total = 10
[code]....
I made a listbox (10 items long). I would like to add a string to the list, with an index of my choice. How would I do that?
View 4 RepliesI have two classes, one nested in the other. [code]Neither "Name" or "ID" are unique between operations and records.I wish to construct a dictionary using LINQ = Dictionary(Of String, Of List(Of Integer), whereby the keys are uniqe examples of Names in my collection and the values are the collective set of distinct IDs that are associated with those names.
View 2 RepliesHow can I structure my classes so that the user interfaces though a single class while the supporting classes are hidden from their view? I think its best understood in an example:
Public Class MyInterface
Public Economic as EconomicClass
Public Sub New()
MyBase.New()
[code].....
So you might ask why am I even separating them? It's strictly for others who will be working with this interface. I need to funnel them though a logical structure:
interface.Economic.MyMethod
interface.Currency.MyMethod
etc
This way everything is already handled for them in the background and they only need to run the method they need. I don't know if I can have it both ways in VB.NET.
i store proxys in a notpad.txt file and im trying to grab all proxys in the notpad and put them into listbox1 i am using
[Code]...
I cannot figure out how to add an item to a listbox with a specific value. I am able to add a text description without any problems, but how can I give it a specific value?
View 13 RepliesPublic MaintenanceMenuList As ListView Function AddItems()
Dim lstModules As New ListBox()
MaintenanceMenuList.Items.Add("item_1")
lstModules.Items.Add(MaintenanceMenuList)
End Function I am receiving an error like "Object reference not set to an instance of an object". What seems to be the problem here?
I am able to only move single items from one listbox to another with this code. I tried with both MultiSimple & MultiExtended SelectionMode.
How do I select multiple items and then move them?
Private Sub cmdAdd_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs
[code]......
(Visual Basic 2010)I'm trying to add multiple item to a listbox from a text file. The program will show help for computer tasks.
Textfile:
Add new event to calender#Sync calender to phone#Print something from the internet
Code:
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
UpdateTopicList()
End Sub
[code]....
before you see any of this, you will have made a text file (dont ask how)
the text file will contain html with an unknown number of lines
(the user will click a button to add a new line to the file, so the number of lines depends on the user
each line will look like this:<a href="www.link.com"> text </a>[URL].. is just a place taker for what the user would have written there as well as "text"
[Code]...
This is what I have so farPublic Class Form1Private Sub IndividualParticularsBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e s System.EventArgs) Handles IndividualParticularsBindingNa
View 3 RepliesMy program is running great with one little problem, it keep adding a zero to my listbox and the multiplication and sum result don't line up well. the result would be like: [Code]
View 10 Repliesi am trying to add items to a Listbox, but first i need to know if the item is already in ListBox. I know how to compare the selected item in a combo with the arraylist. I use this
If Indicadoreslist.Contains(Me.ComboBox2.SelectedValue) Then
MsgBox("It exists")
Else...
[code].....
i am trying to make a program that adds up all of the numbers in a list box and displays them in a text box, how do i do it?t
View 2 RepliesHere is some example code of what I mean:
vb
Public Class Form1
Private Sub Button1_Click(ByVal sender as Object, e as systemEventArgs) Handles Button1.Click
[Code]....