473,800 Members | 3,056 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help with Index out the bound of the Array issue.

Hi There,

I have been batleing with this now that I'm at the end of my rop here.
What I'm doing here is this;
1 - retrieving some data from the database with a data reader (with a
search criteria)
2 - Filling a listbox with the data retrieved with the data reader
3 - draging items out of the listbox and dropping them into a text box
(simple names)

The error I'm getting is on the mouse down event. When a press the left
mouse button to start the drag event, it gives an error saying that the
"index is outside the bounds of the array"
now this is the code I'm using;

Private Sub lstResultSchedu ler_MouseDown(B yVal sender As System.Object,
ByVal e As System.Windows. Forms.MouseEven tArgs) Handles
lstResultSchedu ler.MouseDown

If e.Button = MouseButtons.Le ft Then

If lstResultSchedu ler.Items.Count = 0 Then Exit Sub

'invoke the drag and drop operation

This is the line of code where is failing ****
lstResultSchedu ler.DoDragDrop( lstResultSchedu ler.SelectedIte m.ToString,
DragDropEffects .Move Or DragDropEffects .Copy) *****

End If

End Sub

Does anybody knows why I'm getting this Problem?

Thanks for your help.

Manny
Nov 20 '05 #1
1 1233
Wrong place

Private Sub ListView1_ItemD rag(ByVal sender As Object, ByVal e As
System.Windows. Forms.ItemDragE ventArgs) Handles ListView1.ItemD rag

ListView1.DoDra gDrop(e.Item, DragDropEffects .Move)

End Sub
--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Manuel Canas" <mc*****@hotmai l.com> wrote in message
news:FygGc.6065 0$_5.1574@clgrp s13...
Hi There,

I have been batleing with this now that I'm at the end of my rop here.
What I'm doing here is this;
1 - retrieving some data from the database with a data reader (with a
search criteria)
2 - Filling a listbox with the data retrieved with the data reader
3 - draging items out of the listbox and dropping them into a text box
(simple names)

The error I'm getting is on the mouse down event. When a press the left
mouse button to start the drag event, it gives an error saying that the
"index is outside the bounds of the array"
now this is the code I'm using;

Private Sub lstResultSchedu ler_MouseDown(B yVal sender As System.Object,
ByVal e As System.Windows. Forms.MouseEven tArgs) Handles
lstResultSchedu ler.MouseDown

If e.Button = MouseButtons.Le ft Then

If lstResultSchedu ler.Items.Count = 0 Then Exit Sub

'invoke the drag and drop operation

This is the line of code where is failing ****
lstResultSchedu ler.DoDragDrop( lstResultSchedu ler.SelectedIte m.ToString,
DragDropEffects .Move Or DragDropEffects .Copy) *****

End If

End Sub

Does anybody knows why I'm getting this Problem?

Thanks for your help.

Manny

Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

29
5487
by: shmartonak | last post by:
For maximum portability what should the type of an array index be? Can any integer type be used safely? Or should I only use an unsigned type? Or what? If I'm using pointers to access array elements as *(mptr+k) where I've declared MYTYPE *mptr; what should be the type of 'k'? Should it be ptrdiff_t?
3
1453
by: trialproduct2004 | last post by:
Hi all i am having application in c#. I want to create array of class object at runtime. I don't want to set array bound at design time. How to set array bound at runtime and how to access array element? Can some one help me. Thanks in advance.
4
4623
by: jon f kaminsky | last post by:
Hi- I've seen this problem discussed a jillion times but I cannot seem to implement any advice that makes it work. I am porting a large project from VB6 to .NET. The issue is using the combo box bound to a table as a lookup, drawing values from another table to populate the available selections. This all worked fine in VB6. I have distilled the problem down to a simple form drawing data from the Northwind database for a representative...
0
5577
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted ******************************************************** For this teeny job, please refer to: http://feeds.reddit.com/feed/8fu/?o=25
6
2727
by: sgottenyc | last post by:
Hello, If you could assist me with the following situation, I would be very grateful. I have a table of data retrieved from database displayed on screen. To each row of data, I have added action buttons, such as "Edit", "Add", and "Comment". Since I do not know how many rows of data will be retrieved - and therefore how many buttons I need - I am using button arrays for each button, like so: echo "<input type=\"submit\"...
5
2563
by: weidongtom | last post by:
Hi, I tried to implement the Universal Machine as described in http://www.boundvariable.org/task.shtml, and I managed to get one implemented (After looking at what other's have done.) But when I use to run a UM program, I kept on getting error messages. I have used someone else's implementation and it runs fine. I have compared my code with other's and I still can't figure it out what's wrong with mine. So please help me out, after 3...
9
2519
by: weidongtom | last post by:
Hi, I've written the code that follows, and I use the function add_word(), it seems to work fine *before* increase_arrays() is called that uses realloc() to allocate more memory to words. But *after* calling increase_arrays(), I received segmentation fault. I tried to step it through gdb, and I found out that after calling increase_arrays(), words's original value is modified, and if I tried to access it, I get <address 0x11 out of...
3
9125
by: Jerry West | last post by:
I'd like to get the upper bound index of an integer array. I've tried the following: Dim i as Integer Dim arrayIng() as Integer i = arrayIng.GetUpperBound This doesn't work. It seems GetUpperBound behaves more like a function in that it wants a passed parameter. Is there not a property similar to VB6
9
6284
nine72
by: nine72 | last post by:
Ok, so I have figured out how to parse an custom returned XML doc (actually a string that I made into a doc for testing). At this point I am attempting to integrate my parse routine into my main code and I am having an issue getting it to mesh, and am looking for a little help in how to 1) combine the two and 2) how to catch the incoming xml string. FYI the string is sent to me as a return message to an xml message that I send first....
0
10495
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10248
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10032
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9085
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7573
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5597
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4148
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2942
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.