Find The Index Of The Target Line Under The Mouse When Drag-dropping To A ListView?

Oct 10, 2009

I want to drag-drop single text items from ListView-A to ListView-B (both are in Details mode), but can't see how to read (and hence highlight) the index of the line in ListView-B when the mouse is hovering over it. Easy in a ListBox, but the PointToClient > IndexFromPoint features don't work with ListView controls and I just can't see another way .

View 6 Replies


ADVERTISEMENT

VS 2008 ListView Index - Find Out What Item Has Been Selected In A ListView?

Mar 21, 2010

Do I really have to go through all this just to find out what item has been selected in a ListView?

[Code]...

Isn't there something fundamental like this? Is absolutely everything in VB.NET buried beneath a colossal heap of bureaucracy?

View 13 Replies

Get The Index Of Selected Row In Listview In Mouse Up?

Jun 22, 2010

how can i get the index of selected row in listview in mouse up?

View 2 Replies

VS 2010 ListView MultiSelect Rows With Mouse Drag - Win7?

Apr 23, 2012

In WinXP with LV FullRowSelect enabled I can press and hold down the left mouse button and drag it down the right side of the left-most LV column and the rows are selected, but under Win7 I can only multiselect items with the mouse if FullRowSelect is set to false.

So I guess I need to write code to support this sort of feature for Win7 ? , and if true are there any code examples (I can't find anything) to save me some time?

View 1 Replies

How To Find Index For ListView Items

Jun 1, 2012

How I can find the index for the listview on a listview click event to something like this:
Code:
Private Sub listView1_Click(ByVal sender As Object, ByVal e As System.Windows.Forms.ItemCheckEventArgs)
MessageBox.Show(listView1.Items(e.Index).SubItems(1).Text)
End Sub

I don't want to use for each integer in the listview as i would keep getting the loops which I would hate to use it. I only want to use something like e.Index. I know that the index is not a member in e, but I don't want to use listview item check event due to loops. How I can find the index for the listview items without using for each integer as only using e.index?

View 1 Replies

VS 2005 How To Find Listview Index

Jun 1, 2012

How I can find the index for the listview on a listview click event to something like this:

Private Sub listView1_Click(ByVal sender As Object, ByVal e As System.Windows.Forms.ItemCheckEventArgs)
MessageBox.Show(listView1.Items(e.Index).SubItems(1).Text)
End Sub

I don't want to use for each integer in the listview as i would keep getting the loops which I would hate to use it. I only want to use something like e.Index.

I know that the index is not a member in e, but I don't want to use listview item check event due to loops.

how I can find the index for the listview items without using for each integer as only using e.index?

View 7 Replies

VS 2010 SelectedIndexChanged On ListView - Find The Index

Aug 12, 2011

I have a list view, of which I want to find the index of... Using the click event, I have no problems at all with this code, but SelectedIndexChanged throws this at me:

[Code]...

View 2 Replies

ListView.Find String - Highlight The Line

Mar 31, 2009

I am using this code:

[Code]...

It even indicates if the string I'm seeking is in the middle of a line. But what I would like is for the routine to highlight the line that that string is in and ensure visible. I can do that with another routine that uses an integer, but then the whole string(line) has to be the searchString. I've tried combining the two and even calling a Private Sub but with no success:(What is the best way to do this? Also, how do you get around doing it when the searchWord in in several lines?

View 9 Replies

VS 2008 Listview Drag And Drop (preserving The Listview .tag After Drag And Drop)

May 25, 2011

I am trying to figure out a way to include the listview's tag field when dragging one listview's subitems into another listview. I am hoping someone here has experience with this. My Listview drag code is below - the two listviews that I am dragging subitems into or from are LV1 and LV3. Also, this is being done in Visual Basic 2008 and the project is a windows application.

[Code]...

View 4 Replies

Sql - Unable To Find Specified Column In Result Set Index Out Of Bounds Index Out Of Range Exception

Apr 23, 2012

i am having trouble putting a value in a textbox. Each time a ticket is sold i put the total price in a textbox, each time a ticket is sold for the same concert it increases by adding its self to the total price. It works at the first sale, but after that it breaks down. here is the code

Private Function DisplayMoneyTaken() As Integer
Dim totalMoney As Integer
'open the database connection

[Code].....

View 1 Replies

DoDragDrop List View Item Reordering - User Can Drag Media Tracks From One Listview To Another Listview

Feb 12, 2010

I have a media browser program I am building. I am trying to use drag/drop so a user can drag media tracks from one listview to another listview and then use the second list view as a playlist in windows media player com object. Reading at MSDN I have found out that there is no built in support for item re-ordering with the listview control. I have listview1 working correctly but when I try to reorder items in listview2, the dragged item ends up at the end of the list. So basically I need to get the item insertion index corrected. I have tried more than 10 times to get this code right.

Here is my code which includes a form with two listview's.

Public Class Form1

Private Sub ListView_ItemDrag(ByVal sender As Object, ByVal e As _
System.Windows.Forms.ItemDragEventArgs) Handles ListView1.ItemDrag, _
ListView2.ItemDrag

[CODE]...

View 2 Replies

Add Two Line One Line Is Find The Total Of Each Colums In The Last Row And To Find The Grandtotal?

May 1, 2011

I am suppose to only Find the total of each column in the last row. Find the grand total in the last cell (the bottom right corner)Ok i have tried to do the grandtotal but i am not getting what she wants done I have also tried to reverse the arrays but that was wrong to. I am only suppose to add two line one line is find the total of each colums in the last row and to find the grandtotal.

Module Module1
Sub Main()
Dim sum(5, 4) As Integer
Dim row, col As Integer

[code]....

View 1 Replies

.Lnk Read Target Line?

Apr 24, 2012

I am currently trying to read the target line of a shortcut file, if you were to right click and view properties of a shortcut, you can see the target line which holds the path of the file for execution. I problem is the target lines have attributes/properties at the end of the target line. The code i have atm reads everything except the most crucial part, the data after the .exe.. For example

Say i have a shortcut file whose target line(if you view properties of the file) is as such:

\adminappsVbNetSQLScriptRunner.exe AccountNumberUsage

My current program reads in this part of the target line..

\adminappsVbNetSQLScriptRunner.exe

But i need the last part, its the whole point of the program...why it stops reading when it hits the .exe or how to make it continue till end of the target line. I eventually store each target line returned into an array which ill export to excel later on.The code used to retrieve the target line is below.

Public Function GetTarget(ByVal dt As System.Data.DataTable)
Dim path(dt.Rows.Count - 1)
Dim wshLink, strPath, wshShell
Dim rc As Integer = 0

[code]....

View 3 Replies

Find Out Wherer A Mouse Button Is Pressed When Mouse Pointer Is Leaving A UIElement?

Apr 6, 2011

I've been working on a GUI in WPF which I'm fairly new to, having only used Windows Forms up until now. So far, my GUI is very simple: it contains two rectangles, each of which drops a shadow. The shadow creates an effect of rectangles "floating above the canvas" so to speak.

When one of the rectangles is pressed, the myRectangle.MouseDown event is handled such that the shadow goes away, thus creating an effect of the rectangle being pressed down onto the canvas, like a button.Similarly, when mouse button is released, the myRectangle.MouseDown event is handled such that the shadow reappears and the rectangle "floats" again. This behavior make them resemble buttons. Note, there a reasons I want them to be rectangles and not custom buttons.

[Code]...

If the pointer leaves a rectangle while mouse button is pressed, I'd like shadow to reappear. This is arguable simple, because theoretically in this case, any time myRectangle.MouseLeave is raised, the shadow should come back on, even if it was already there.If the pointer left a rectangle when mouse button was pressed, then came back while before the button was released, I want the shadow to disappear again. This one is what gives me problems. No idea how to do this.

View 1 Replies

Find Out The Mouse Coordinate To Make Image Follow Mouse?

Mar 6, 2012

I am try to make a character that follows the mouse, but I cannot find any way in vs 11 to get the mouse coordinates? It is a vb application, could someone please help me out? I tried pointer.location, pointer.margin, but still cannot do it.

View 5 Replies

VS 2008 : Read A File Line By Line Into An Array But It Skips The Item At Index:3?

Mar 17, 2010

I'm trying to read a file line by line into an array but It skips the item at index:3 I have it msgboxing just to make sure and it wont even touch it.

Dim Btn As Button = DirectCast(sender, Button)
Dim path As String = Application.StartupPath & "Libraries" & Btn.Text.Replace(" ", "_") & ".ipt"
Dim i As Integer = 0
Dim lines As String() = IO.File.ReadAllLines(path)

[code]....

View 3 Replies

.net - Find The Target Of A Symbolic Link?

Dec 31, 2010

How can I find if a given file is a symbolic link? And once I know that it is, how can I get the target its pointing to? I'm using VB.NET in Visual Studio 2010.

View 3 Replies

VS 2008 Find Target Of DoDragDrop?

Mar 25, 2009

While I can do DoDragDrop() to initiate a FileDrop from a listview to Windows Explorer, how can I tell anything about the target of the drop? For instance if I wanted to find the path where my files were dropped to?

Example:

1) User clicks and drags listviewitem which turns into a FileDrop with a file's path.

2) DoDragDrop completes and the file is moved.

3) ?? How do I tell where it was moved to ??

View 1 Replies

Get The Column Index And Row Index On ListView?

Apr 6, 2010

How can i get the Column Index and the Row Index when I click on the ListView?The ListView1.FocusedItem.GetSubItemAt(e.X, e.Y).Text function only gets the text of the first column, I can't find the option of getting the Index of the Column and Row upon clicking.

View 9 Replies

Drag A Control With The Mouse?

Jun 21, 2010

I'm trying to convert a simple program fron vb6. IT's only draggin several pictures with the mouse and drop them into anothet picture (trashbin). If the object picture dropped is a match then the trashbin.image changes to another image But: First, I don't know how to allow drag controls!

View 5 Replies

.net - Drag And Move Winform Using Mouse?

May 28, 2011

I know how to 'drag and move' a winform by adding following code

Protected Overrides Sub WndProc(ByRef m As Message)
If (((m.Msg = 163) And ClientRectangle.Contains(PointToClient(New Point(m.LParam.ToInt32)))) And (m.WParam.ToInt32 = 2)) Then
m.WParam = CType(1, IntPtr)

[code]....

But after a panel being added to winform, I can not 'drag and move' the winform within that panel area. Any idea of how to 'drag and move' within a panel? I mean the mouse point, click, hold and move within that panel and the winform will follow the mouse movement until I release the mouse button.

'Add these to your form class
Private MouseIsDown As Boolean = False
Private MouseIsDownLoc As Point = Nothing

[code]....

View 1 Replies

Drag And Drop Mouse Cursor?

Jun 6, 2011

I'm trying to find a drag and drop cursor for use in a program. It is not in the standard Windows cursors. It's the one you see when moving a control in Visual Studio or when reordering slides in powerpoint - arrow with rectangle below.

View 5 Replies

Drag The Button To The Position Of Mouse?

Jan 30, 2009

Public Class Form1
Dim i(1) As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As

[Code]......

What im trying to do is when u have the mouse hold down you can drag the button to the position of your mouse, however all it does on mouse down is move it to the bottom right and if i keep click it will keep going down til its off the screen.

Im trying to make a drag drop styled interface for user customization.

View 2 Replies

Emulate Mouse Click And Drag?

Jan 19, 2010

Emulate mouse click and drag?

View 16 Replies

.net - Track Mouse Click And Drag Events?

Jan 12, 2011

First, I want to know if the mouse is in some area. Then, I want to check if the mouse holds the left click. I want to check as long as the left button is down, and I want to track the mouse's position. And finally, check when the left button is released.

So, in short, where should I start for tracking mouse events in my form?

View 3 Replies

Window Looses Mouse Event On Drag?

Mar 4, 2010

Here is a simple code i have put a timer with 4 seconds interval.If i start dragging the form with keeping the mouse button pressed and when the timer tick event fires i am changing the Me.ShowInTaskbar to reverse at that time the mouse looses the capture. Is there any way to keep it draging even after changing the ShowInTaskbar state.

Public Class Form1
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Me.ShowInTaskbar = Not Me.ShowInTaskbar
End Sub
End Class

View 3 Replies

Sort ListView By Image.Index If Index Over 4 Sort Rest Alphabetically

Apr 12, 2012

Currently my ListView sorts items by image.index. So 0 is at the top, then 1, 2 and so on. Think of it as an IRC chat room nick list. Ops at top then the rest are sorted alphabetically

[Code]....

View 18 Replies

DataGridView Drag And Drop Mouse Position Error

Oct 17, 2009

I'm writing an application for seat reservations. I use a DataGridView to represent seats. Each free seat is coloured in green and occupied seats are in blue.DataGridView is populated with names from database and user could add a name to a seat choosing from a list.Moreover the user has the possibility to move a name from one seat to another - not occupied via drag and drop operation.Eveything works well, but when moving a name from one cell to another I have to position the cursor over a cell that is one row above and four columns on the left of that one I choose.Which is the reason? Here is the code

[code]...

View 1 Replies

Drag/Drop/Mouse Events In User Class?

Oct 24, 2009

is it possible to link a personal created class with a Mouse Event? I created a class and I want to make it possible to make it interactive with the mouse. So when the user goes over the GDI-created shape (which is declared and created in that class), he has to see some information about that shape, like the name etc.... And the user has to be able to drag and drop that shape.

View 2 Replies

VS 2010 Detecting Mouse Position During Drag & Drop?

Feb 15, 2012

Is there any way of detecting the position where the Mouse Button is released during a Drag & Drop operation. I need to know whether the intended Drop position was not reached when the mouse button is released.

View 8 Replies







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