Cannot Figure Out Why ArrayList.RemoveAt() Is Not Working?

Jul 28, 2011

I am currently using Florian Leitner's HID USB library in my VB.NET solution for communicating with a pin pad. As per his sample code, I set up an event handler to handle incoming responses from the device which are stored in an ArrayList called usbBuffer:

View 1 Replies


ADVERTISEMENT

Why ArrayList.RemoveAt() Is Not Working

Jul 28, 2011

I am currently using Florian Leitner's HID USB library in my VB.NET solution for communicating with a pin pad. As per his sample code, I set up an event handler to handle incoming responses from the device which are stored in an ArrayList called usbBuffer:

[code]...

The problem is that the RemoveAt is not working, since the first element in the list remains there after the handler is done. Could someone please advise as to what I've done wrong, or perhaps use a different approach?

View 1 Replies

MSDN - Collection(Of T).RemoveAt Method

May 25, 2012

The MSDN page for this method says this: ArgumentOutOfRangeException. index is less than zero.-or-index is equal to or greater than Count. That doesn't make any sense, surely it should be "index is equal to or greater than (Count - 1)" Since index is zero based. I need to know since I'm Overriding the RemoveItem method for a Class that Inherits Collection(Of T).

View 6 Replies

Checklistbox.RemoveAt Unchecks Next Item In Listbox?

Oct 28, 2011

Heres some test code I used. Just a checklistbox on the form with this code-behind:

Dim list As New List(Of String)
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
For i = 0 To 10
list.Add("Test " + i.ToString)

[code].....

I use a list to keep track of the items in the listbox, so if I remove one of those items from the listbox I want to also remove it from the list using the same index.If you use this code and load the form and then check all the items, youll notice that when you uncheck one it will remove the item and THEN also uncheck the next item...why is that?

View 4 Replies

RemoveAt Very Slow To Load / How To Make Fast

Mar 22, 2012

After I RemoveAt my payList, it appear very slow in edit form, but in new form no problem.How to make it faster. [code]

View 1 Replies

Copy The List Of Principal User To Arraylist To Use Arraylist.indexof?

Dec 1, 2011

What I am doing is iterating through all the groups that belong to the top group (Generic reports). Then I take advantage of the GroupPrincipal.GetMembers(True) which will recurse through a given group name. I test to see if the user exits under that group and if true I put the group name in an arraylist.

I use the for each principal in GroupPrincipal.GetMembers to loop through each returned user to see if they exist.

Is there a way to put all the returned users Principal.Name from a given group in GroupPrincipal.GetMembers into an ArrayList? This would allow me to to use Arraylist1.IndexOf to search for user. Which would be much faster then iterating through a returned list using the for each construct.

Sub RetAllMbrs(strUser As String)
Dim oPC As PrincipalContext = GetPrincipalContext() '<- this is function somewhere else in the code

[Code].....

View 1 Replies

VS 2010 Threading & ArrayList - Use Adding A String To ArrayList In Tread?

Jan 11, 2012

I have a problem in Treading.I have a code like this;[code].....

I want to change ListBox1 with ArrayList. But I couldn't find how to use adding a string to ArrayList in tread.

View 5 Replies

Question If ArrayList Contains String Remove It From New ArrayList

May 6, 2010

I have an arraylist (arrFirstArry) which I use to populate another arraylist (arrNoDuplicates) preventing any duplicates from being added. This works fine. What I would also like my code to do is prevent adding any partial values which may exist from being added. i.e. my array is like this

[Code]...

View 2 Replies

Struct - .net 2003 Arraylist Of Structure Which Have An Arraylist?

Sep 22, 2011

I have two structures Public Structure myResearchData

Public batchName As String
Public arraylistRData As ArrayList
End Structure
Public Structure myResearchSubData
Public researchDescription As String

[Code]...

Cleared MyResearchData.arraylistRData for new data to be put in but it also clears the arraylist inside MyResearchDataAList and didn't old the contents of the arraylist

View 1 Replies

VS 2008 - Reading ArrayList In My.Settings And Add Another ArrayList To It

Sep 21, 2010

What I need to do is read an ArrayList in My.Settings and add another ArrayList to it. The first think I'm trying to do is load My.Settings.Records into myArrayList. I'm not quite sure on the proper way to do this. I've tried things such as Dim myArrayList As ArrayList = My.Settings.Records, I'm not sure if I need New and I'm not sure if I need .Clone or .CopyTo.

Then I have another ArrayList myArrayList2. To get this into myArrayList I've done: [Code] Then to save it back to My.Settings I've done. My.Settings.Records = myArrayList. The problem is I keep on getting Object reference not set to an instance of an object error on the AddRange line. My.Settings.Records is definitely an ArrayList and it will sometimes = Nothing. The objects will only ever be strings.

View 19 Replies

Can't Seem To Figure One Out?

Nov 24, 2009

My programming days are many years in the past - so I'm trying to get back into it. My current problem is as follows - I have a word document that is set up as a mailmerge document that is merged to email (through outlook). The merge records are in an excel spreadsheet (the email address is in a field called EMAIL). My emails are getting rejected by the recipient domain because they're being sent too fast (so they therefore think that they're spam).

I need to create a VB Program that will use the document called MASTER and merge it with the spreadsheet called RECIPIENTS and send via Outlook. However, I need it to send the first 10 emails, wait 10 minutes, send the next 10, wait another 10 minutes and continue cycling through until all of the emails have been sent.

View 3 Replies

Can't Figure Out What To Put For Argument

Mar 8, 2012

[URL]It is a sub that is meant to add a user to a group in Active Directory. However, I can't seem to figure out how to use it. Here is the code:

''' <summary>
''' Method to add a user to a group
''' </summary>
''' <param name="de">DirectoryEntry to use</param>

[code]....

I'm not sure what to put for the first argument when calling it. For example:

AddUserToGroup(?, User, Group)

View 1 Replies

Cannot Figure Out How To Get VB To Get Any *.jpg File

Mar 16, 2010

I am trying to write a program where every 30 seconds a jpg file is put in a PictureBox object. So far I am only able to get 1 jpg file every 30 seconds - twice - that is only 2 jpg files and not say 30 jpg files.

View 5 Replies

Figure Out A Way To Get The Even And Odd To Work?

Jun 22, 2010

I have two text boxes, submit button. and a dropdown list with the items(even, odd, and all). I want to calculate the sum of either all "Even", "Odd" or "All" numbers according the selection. In the code below, I have the "all" section working correctly but I'm trying to figure out a way to get the Even and Odd to work.

Some one suggested me to develope a good formula for determining whether a number is even or odd, then calling that from within the program as needed. I've tried that below with the IsEvenNumber function but got stuck. Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click

[code]...

View 1 Replies

VS 2008 Can't Figure Out This

Jul 15, 2009

Below is the code im using to select fields from a table.I have 6 labels on a form. I want each label to have the value of the field selected.

Example,

I have a label named lblTeacher on the form. Because i'm selecting the Teacher field from the table in the OLE string, i want to be able to assign the value of that to the label. This is the same for all the other fields selected. How would i manage this?

[code...]

View 2 Replies

Can't Figure Out The Format For This Operation?

Jun 13, 2012

I have an array of a structure and I need to assign an element of this array to a variable of the same type. In vb6 I'd use something like the following pseudo-

View 3 Replies

Can't Figure This Editable Listview Out In .net?

Feb 17, 2012

i have my project working fine in vb6,,but when i try to convert it ..well you know what happens 99.9% of the time.Anyhow all i have been able to get working is the code below.which basically just throws a textbox up onto the listview where ever the mouse is clicked at..but i can't figure out how to get it to lock into any of the cells,columns etc.can someone just show me the simplest way to get the textbox to lock into the cell that the mouse clicks on..or subitem etc.I have no more hair to pull out..I'd start pulling teeth..but I'm already passed that option too

[Code]...

View 12 Replies

Figure Out The 'bytestowrite' Command?

Dec 1, 2009

I'm trying to figure out the 'bytestowrite' command, but I'm not having much luck.I'm sending some info over COM1 to and LED sign, and since it runs at 300 baud it takes a minute or so to transfer. I was trying to use the 'bytestowrite' command to find out how many bytes still needed to be sent, and use that info with a progress bar, but I'm always getting 0 when using 'bytestowrite'

Below is the code I tried to get the bytes left to write into a label box, but I've probably got it wrong (but I like to try to figure things out before I ask for help).

Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
Using com1 As IO.Ports.SerialPort = My.Computer.Ports.OpenSerialPort("COM1", 300, Ports.Parity.None, 8, Ports.StopBits.One)
Label1.Text = com1.BytesToWrite

[code]....

I thought putting it in a timer would keep checking the com port to see if there were any bytes to be written, but it always shows 0.

View 3 Replies

Figure Out The Relationship Between Three Classes?

Jul 13, 2009

I cannot figureout to which class ItemStatus should link to!please refer to my blog in the following link to detail description of the issue

View 2 Replies

Create An Array Of An Array (or Arraylist Of An Arraylist) To Hold Strings?

Mar 20, 2012

I want to create an array of an array (or arraylist of an arraylist) to hold strings.I want to fill an array1 with string values Then add this array to array2. - but only taking up 1 row in array2 e.g something like array2(index)=array1 Then clear array1 then loop through this again with different data, and add it to the array2.so will end up with something like

array2(0)... contains a collection of array1 data
array2(1)... contains a collection of different array1 data
.. and so on

i think i need to make new instances of array1 each loop, but not sure.I dont mind if it uses arrays, or arraylists, or lists, or structure of arrayslists?

View 6 Replies

Cannot Get Hands On Save Code To Figure It Out?

Jun 1, 2010

I cannot get my hands on any "save" or "save as" code to figure it out, can anyone point me in the right direction?

usiing VisualStudio 2008 vb.net
Brenton W Garman

View 2 Replies

Communications :: Figure Out An ASCII Protocol?

Jul 20, 2010

I am trying to work out an ASCII protocol and I have managed to parse everything I need from the transmission, but have not been able to figure out bytes 14-17 and byte 20 of the response. Here is a transmission packet in Hex.

[Code]...

View 2 Replies

Figure Out The Time Between Timestamps And Then Average?

Dec 8, 2011

I need to figure out the time between timestamps and then average that time by the number of timestamps. Not sure how to go about this...

View 13 Replies

How To Do First Select Case Can Figure Rest Out

Feb 18, 2010

I found this code on here while doing a search and would like to be able to use it but it was written in C and I dont know much about that (don't know that much about VB.NET either but trying to learn)[code]What I do have is a text box where a user enteres a desired number of US dollars to convert to three types of currency.I know how to convert the string entered to an integer so the calculation can take place. What I don't know how to do is modify the above code so that the results will show up in the correct text boxes after each calculation (yes I know I have to convert the integer back to text).If someone could show me how to do the first Select Case I can figure the rest out.

View 12 Replies

Unable To Figure Out Regex Pattern

Oct 1, 2011

I have a string with some custom formula like FVAL("A")+FVAL(B). I want to figure out all string inside FVAL() which does not have quotes around it.

So basically I want to extract out B because it does not have quotes around it.

View 2 Replies

Difference Between ArrayList In VB From ArrayList In C#?

Apr 12, 2012

s there a difference between the arraylist in visual basic and arraylist in C#? I had to convert some C# code to VB and there is a call I make in a third party api that requires me to pass in an arraylist. When I do this in C# it works just fine, but when I do this in VB, I just get back a vaque exception from the api.

[Code]...

The exception I get is very vague and comes from the API. All i get is, "ARException Occured".

View 14 Replies

Can't Figure Out Whats Wrong With This Two Basic Codes?

Oct 12, 2010

No errors are given in either first or second code besides theinputbox whats wrong here ?

1:)
Dim readings(-1) As integer
2:)

[code].....

View 2 Replies

Can't Manage To Figure Out, The Program Has To Switch To The WoW Window?

Nov 2, 2009

I'm Jojo and i'm developing a program to help ppl in WoW.There's just 1 function which I can't manage to figure out, the program has to switch to the WoW window when I click a button.

View 19 Replies

Draw A Figure With Graphicpath With Different Color And Dimension?

Oct 6, 2011

i need to draw a figure around a panel (so with the method startfigure and close) with different dimension and colors, but i don't know how to do.

View 9 Replies

Figure Out Different Ways Of Making Programs Work?

Jun 22, 2010

I've been going through a VB book I had while in College, and was trying to figure out different ways of making programs work.One assignment was to create a multi-dimensional array to figure out wind chill factors. The only part I really can't get to work right is using 2 numericUpDown controls. Using 2 dropdown menus was obviously easy because the items are indexed, but as far as I know, numericUpDown controls are not indexed.

Instead I used 2 selectCase statements to determine the index in each updown control, then passed the indexes to a function to determine the answer.The numericUpDown controls both increment by 5, (wind from 5 to 30) (temp from -20 to 15)Just looking to see if someone has any ideas of a better way of doing this.

[Code]...

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved