Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 1st, 2006, 12:35 AM
Friend of Wrox
 
Join Date: Mar 2005
Posts: 264
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to change color of selected external listview

could any one show me how i can change the color of selected external listview item to a color i specify.Thanks

 
Old July 3rd, 2006, 03:46 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

What is an "external listview item?"
 
Old July 3rd, 2006, 10:42 PM
Friend of Wrox
 
Join Date: Mar 2005
Posts: 264
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by BrianWren
 What is an "external listview item?"
well external listview is an listview in diffrent program. A program that i do not have its source code. There is this application that has listview on it and i want to change color of one of its item which is already selected. The default color is black an i want to change it to orange for example. I hope an expert show me how to do it. The item is already selected and all i want to change the text of that selected item.

 
Old July 5th, 2006, 01:00 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Without knowing what that control was named by the person who wrote the program (which would require the source code, which you say that you don't have) this will be about impossible. There might be a set of APIs that allow you to retrieve the name of the active control of the window that has the focus, but I’m doubtful.
 
Old July 5th, 2006, 04:34 PM
Friend of Wrox
 
Join Date: Mar 2005
Posts: 264
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by BrianWren
 Without knowing what that control was named by the person who wrote the program (which would require the source code, which you say that you don't have) this will be about impossible. There might be a set of APIs that allow you to retrieve the name of the active control of the window that has the focus, but I’m doubtful.
It is very possible . I already managed to select and highlight any listview item i want but i do not know how to change its color.we can change caption of any window we want knowing its class name so changing color should not be more difficult. But could u tell me what u mean by controle name ? since i might be able to find that some how.Thanks

 
Old July 5th, 2006, 08:12 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It is not possible to select the color for a sigle item of the ListView control, regardless if the listView is internal to your project or belonging to another application. Well, unless you subclass the window of course, but I wouldn't do it...
 
Old July 5th, 2006, 08:15 PM
Friend of Wrox
 
Join Date: Mar 2005
Posts: 264
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by marcostraf
 It is not possible to select the color for a sigle item of the ListView control, regardless if the listView is internal to your project or belonging to another application. Well, unless you subclass the window of course, but I wouldn't do it...
could u teach me how to subclass the window that holds that listview ? i realy want to learn this. Thanks

 
Old July 6th, 2006, 12:34 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:
could u teach me how to subclass the window that holds that listview ? i realy want to learn this. Thanks
take a look at this:

http://www.experts-exchange.com/Prog..._10142124.html

I did not try the code, but the idea is that. If you google for "vb6 subclass" you'll find tons of other examples.
 
Old October 20th, 2006, 07:01 PM
Registered User
 
Join Date: Oct 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

How you did it?I am trying to read title of active window. But if it is outlook window, I want to read email currently selected..how I can do that? pl help.


Quote:
quote:Originally posted by method
 
Quote:
quote:Originally posted by BrianWren
Quote:
 Without knowing what that control was named by the person who wrote the program (which would require the source code, which you say that you don't have) this will be about impossible. There might be a set of APIs that allow you to retrieve the name of the active control of the window that has the focus, but I’m doubtful.
It is very possible . I already managed to select and highlight any listview item i want but i do not know how to change its color.we can change caption of any window we want knowing its class name so changing color should not be more difficult. But could u tell me what u mean by controle name ? since i might be able to find that some how.Thanks






Similar Threads
Thread Thread Starter Forum Replies Last Post
Change color of items in a ListView eresina Pro VB 6 6 September 15th, 2016 05:09 PM
change the color of selected text dynamically NEO1976 Flash (all versions) 1 December 18th, 2007 11:11 AM
How to change the color of selected row of an HTML bhavna HTML Code Clinic 4 February 11th, 2007 09:22 PM
How to get selected item from listview? try.test.abc C# 1 January 4th, 2007 02:34 AM
Listview doesnt change after items are selected. hexOffender VB.NET 2002/2003 Basics 0 December 13th, 2006 12:28 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.