Get The First/last/min/max Logical Item Of A List?
Dec 17, 2010
Sorting arrays are useful when you want to get the first/last/min/max logical item of a list. I.E. A list that contains numbers and you want to find the Min/Max (without LINQ), you can sort the list and pull the first/last element. It's also useful to display lists to the user in alphabetical order.
View 2 Replies
ADVERTISEMENT
Jan 1, 2012
I have a list box on the form which functions as a copy/paste. When you copy something, it is automatically added to the list box as a "clipboard helper". Here is the problem,however: if the text is more than 1 line, the list box does not show all the text.It ends up looking messy.So getting back to my question, is it possible to make the list box item height for an item depending on the amount of lines that item contains?This is a one line sentence in the list box and should take up one line.This is a multi line sentence in the list box and should take up two lines for item height.
View 11 Replies
Feb 12, 2011
I'm having some difficulty with a sorted & grouped listbox in WPF vb.net 3.5 that has an items source bound to an ObservableCollection.
What I want to be able to do is to retrieve a piece of data from the ObservableCollection items source depending on what item in the listbox the user has selected.I've almost got it working but because the listbox is sorted it does not match the index of the items source.
[code]...
As I previously mentioned, because the lstBox is sorted and also grouped the index's don't match up.Does anyone know how I can get the correct information I want from the List Source depending on the selected item in the list box?
View 3 Replies
Oct 13, 2011
How someone would select an item from a list box and click a button and have that item go into another listbox with it's price? I seem to be stuck on this part.
Here's my code:
I want to select the first option from the first listbox and I want to put it into another listbox along with the price of that item on the same line in the listbox. I can't seem to figure out how to that.
Public Class Form1
Const dcmPRICE_STRESS As Decimal = CDec(595.0)
Const dcmPRICE_TIME_MANAGMENT As Decimal = 695
[CODE]...
View 12 Replies
Feb 13, 2011
my program downloads into a combobox every item(line) that is in a text file located on a server.
Every line in the text file ends with "a)" or with "g)".
Now I just want to make 3 radio buttons:
- one that will allow the download in the combobox only the item ending with "g)"
- one that will allow the download in the combobox only the item ending with "a)"
- one that will allow the download in the combobox of both (I already know how to do).
How can I do so?
To download the entire list in the combobox I do:
Dim List As String = client.DownloadString("http://mywebsite.com/mytextfile.txt)Dim lines As String() = List.Split(New String() {ControlChars.CrLf}, StringSplitOptions.RemoveEmptyEntries)ComboBox1.Items.Clear()
ComboBox1.Items.AddRange(lines)
View 13 Replies
May 14, 2012
how whould I go about deleteing an item from a listbox and it will select the next available item.you know like the treeview control selects the next node if you delete one.
View 2 Replies
Mar 23, 2011
Public Class notifierMain
Public Class Contacts
Inherits List(Of row)
Public Sub New()
[code]....
When I debug this winforms application I get curType = "notifier.notifierMain+Contacts+row" I want to the Validate function to know it is in MyContacts. How do I do this?
View 3 Replies
Jun 18, 2009
i want to stop accepting form drop down listbox if certrain criteria is not met [code]how i can cancel the selection of drop down list?
View 3 Replies
May 5, 2010
i want to search item A (from a list of X items) in list B but i want to get the item not found example Search ITEM A in LIST B if not found then return a print....if found continue with ITEM B..and so on.
View 5 Replies
Jan 11, 2011
I have a List myList of MyObjects. Is it possible to check if myList contains a particular myObject based on a property of myObject in VB.NET? In C#, you'd something similar to this right:
myList.Exists(myObject => myObject.property1 == 3)
View 2 Replies
May 30, 2011
I have a List(Of MyObj), and I want to iterate through that list and compare each element to all other elements in the same list, excluding (if possible) the same element. I have a solution that works, but it's slow and uses double For loops. It may possibly have also summoned Cthulhu from his sleep. This below is a sanitized version of what I have:
Dim MyList As New List(Of MyObj)({Obj1, Obj2, Obj3, Obj4, Obj5, Obj6})
If MyList.Count > 0 Then
For i = 0 To (MyList.Count - 1) Step 1
[code]....
View 3 Replies
Nov 15, 2011
I want to know how to test the 1st list box if it has items more than the other list box but by one item, here is what i have: If lstInvisibleTv. Items.Count > lstInvisiblePc.Items.Count Then it works good if the lstInvisibleTv list box is greater than the other list box by one but it also works if it is greater the other one by one or more which I do not want. I want it to work just by one.
View 3 Replies
May 27, 2012
I have a program that will compare an array of grocery list items glist and an array of coupon item clist.When I compare the two and if there is a match somewhere in the array I want to have a picturebox visible.When there is no match, I want the picture box not to be visible. [code] The code seems to work great until I come to the else statement.When the code finds a match it displays the picture box and the msgbox without error, but as soon as the message box is cleared, even though i've input it as an ELSE statement, the picturebox goes false again.Does anyone have any idea of how I can "hold" the picturebox to stay visible while the match between the arrays exists?
View 18 Replies
May 25, 2012
Regarding my college project. i'm working on a sales system . i have a form which consist of all the following information( item code , item name , item price , quantity of item ) which is display using a data grid . data input by user using text box and all this information will be stored in a database(sales database) i'm using ms access 2007. the grand total will be displayed in a text box . and amount paid will be input in a text box too , my major problem now is how to i create a reciept that will have all this information of the purcase. i have a reciept button . what the next step ? i dont have any idea how to get the reciept done.
Imports System.Data.OleDb
Public Class Form5
Dim con As New OleDbConnection
[CODE].......................
View 9 Replies
Dec 29, 2010
Did anyone else read this article under Visual Basic News? I thought it was a very bad treatment of the subject. I especially don't like articles like that when the code they post relies on Option Strict Off.
View 12 Replies
Aug 9, 2010
i'm trying to find a way to get with vb.net info regarding logical drive such as: Total Size, Free Size and Volume label ame and to write the info to some textbox or somthing similar.
View 8 Replies
Aug 9, 2011
According to MSDN The And operator can act as a bitwise operator OR a logical operator.The only way to know if it is used as One operator or another is, If it is on the right side of an assignment operation? for example x = 3 AND 5. I cannot find any other instances where the bitwise operator would be used instead of the logical operator, are there?
View 1 Replies
Jun 5, 2010
I don't know the codes to lock the logical drive What it will be if anybody knows it
View 1 Replies
Apr 29, 2011
Is it possible to create a logical serical port in vb that another application can open and read/write to?
View 2 Replies
Aug 18, 2010
Display Size Of Logical Drives
View 23 Replies
May 21, 2010
I need to test a logical expression held in a string to see if it evaluate to TRUE or FALSE.(the strig is built dynamically)For example the resulting string may contain "'dog'<'cat' OR (1>4 AND 4<6)". There are no variables in the string, it will logically evaluate. It will only contain simple operators = > < >< >= <= and AND , OR and Open and Close Brackets, string constants and numbers. (converted to correct syntax && || etc.)
I currently acheive this by creating a jscipt function and compiling it into a .dll. I then reference the .dll in my VB.NET project.
class ExpressionEvaluator
{
function Evaluate(Expression : String)
{
return eval(Expression);
}
}
Is there a simpler method using built in .NET functions or Lamdba expressions.
View 2 Replies
Apr 6, 2011
I've seen the operator Max used two different ways. The following two queries produce the same results. The MSIL code is slightly different. What is the benefit of using the Aggregate operator? Logically, is there a difference?
[Code]...
View 3 Replies
Jan 20, 2009
I have the need to express simple conditionals as program input. The input must be human readable. Is XML suited for this? For example, I have the following conditional statement:
If AnimalType = Leopard And (SourceCountry = Kenya Or TargetCountry = Kenya) Then
ZooKeeper=Jack
Else
ZooKeeper=Jill
End If
Expressing the above in XML might look something like this:
<If>
<Conditional>
<And>
<AnimalType>Leopard<AnimalType>
[Code] .....
How best to represent conditional statements in XML? I haven't yet explored using attributes. I don't currently have the need for nested 'If' statements or the 'Else If' clause, but I'm going to try and work them in anyway. Perhaps the VB code is more 'readable' than XML can be in this case and I should create a custom flat-file format instead.
View 4 Replies
Feb 16, 2010
I am listing all logical drives with GetLogicalDrives() function and i am getting that----( A: , C: , D: , K: , M:)[code]If i checks "Get FilesCount (Drive_name)" for A: (Floppy Drive) then I gets error "DRIVE NOT READY".I want CODE WITHOUT THIS ERRORRR Even if floppy drive is empty or a CD/DVD-ROM is empty.
View 1 Replies
Jan 5, 2012
I created a class where i declared some properties.[code]...
This gives me an error about Index was out of range. Hpw can I properly access the properties in BlogPost class?
View 2 Replies
May 13, 2011
Nearly identical to How can I get every nth item from a List<T>?
But I'm having trouble turning
List<T> list = originalList.Where((t,i) => (i % 5) == 0).ToList();
Into VB.Net code.
View 2 Replies
Feb 25, 2012
Does anyone know the code to address Logical Block 0 of a disk? This is my dump of block 0 of a multipartition disk.
[Code]....
View 15 Replies
Aug 19, 2011
I'm trying to create a Combobox List and I created the following my first try:
Private Sub ComboBox1_DropButtonClick()
ComboBox1.List = Array("LI-3:comparing and contrasting two or more print sources based on
[code].....
View 1 Replies
Jan 23, 2012
i am trying to 'Update' an item in a list The idea i was try to use was going to be to remove the item then add it again. so far this is the code i have
[code]...
The problem i am having is here,Tempcarmake has a Make property which holds the car make eg Honda, Ford, VW i want to find the item in the that has the same Make as the TEMPcarmake that the user has been using
View 1 Replies
Dec 22, 2009
I'm trying to drag a listitem from a listbox onto a picture box. The list item is a persons name. The value member of the list item is the ID of the people listed. When I drop the list item onto the picture box I want to use the persons ID to query a photo and load that photo. I can't seem to access the value though, only the name text, using e.Data.GetDataPresent where e is the DragEventArgs. Could someone point me in the right direction?
View 2 Replies