473,395 Members | 1,411 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Ghost Selection

Hello,


In my application I have a Listview Control and I have written the code to move list items either up or down in the list. Also, the item being moved remains highlighted as it goes up or down. That part works fine,... almost. The only glitch in the system is that when I move the list item up, it leaves an outline of a selection on the last row of my list. It remains there regardless of which row is highlighted.

I do not know why it is there but I want to get rid of it without losing the functionality of my buttons that move a selected list item up or down on the list. Can anyone help me?


My up button code is as follows:

Expand|Select|Wrap|Line Numbers
  1.  
  2. 'Defines Variables
  3.         Dim strDepartment As String
  4.         strDepartment = txtDepartment.Text
  5.  
  6.         Dim strCatagory As String
  7.         strCatagory = txtCatagory.Text
  8.  
  9.  
  10.         'Determines Index
  11.         Dim Index As Integer
  12.         Index = ListView1.SelectedIndices(0)
  13.  
  14.         'Remove ListView Row
  15.         ListView1.Items.Remove(ListView1.SelectedItems(0))
  16.  
  17.         'Inserts Listview Row one level up
  18.         Dim objListItem As ListViewItem
  19.         objListItem = ListView1.Items.Insert(Index - 1, strDepartment)
  20.         objListItem.SubItems.Add(strCatagory)
  21.  
  22.  
  23.  
  24.         'Selects ListView row one UP
  25.         ListView1.Items(Index - 1).Selected = True
  26.         ListView1.Focus()
  27.         SendKeys.Send("{Down}")
  28.  
  29.  
Jan 4 '13 #1
0 1295

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Roger Shrubber | last post by:
I have a page with images that the user can drag from one frame to another. I need them to see a "ghost image" of the image they are dragging, while the original stays put. I use the onmousemove...
2
by: otisim | last post by:
I have a test environment that we rebuild servers on a regular basis. To streamline the process we use ghost. We will be installing SQL on the servers and want to build a ghost image with that...
2
by: Peter Flickinger | last post by:
I have been using a label with the TreeView control - to simulate the ghost image of a node during drag/drop (so that a ghost of the node appears to be floating next to the cursor on a drag/drop)....
2
by: Peteroid | last post by:
When the application I'm working on is run it creates a panel with a Paint event customized to draw primitives (circles, rectangles, etc.), places the panel on a form, and then launches the form....
1
by: Tim Marshall | last post by:
Does anyone else get "ghost" VB editor windows appear on their computers when developing in Access 2003? These are VB editor windows with no menu items and a grey empty background. I usually...
1
by: Howard Kaikow | last post by:
It was my expectation that a sub using the usual recursive FindFirstFile/FindNextFile would be able to walk the directory tree on any logical volume. I am finding that this may not be the case...
0
by: bbcrock | last post by:
I do not have a link to point you to at this time, sorry. It's an internal application. I have some JS code that hides the current div, sets the tabnumber passed in as the current tab number,...
1
by: bbcrock | last post by:
I do not have a link to point you to at this time, sorry. It's an internal application. I have some JS code that hides the current div (group1Tab1), sets the tabnumber passed in as the current...
2
by: Geolas | last post by:
Hi, new to this community.I am not really sure if this was the right place, because this community seem to be for developers really. Well my question is, as the topic states, how to create a...
2
by: buntybutt | last post by:
Hi!!! I have the windows Xp proffesional service pack 1 Symentec Ghost edition. I want the service pack 2 Ghost edition. Help me to get URL. Thank you very...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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...

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.