ListView with XP theme?? 
Author Message
 ListView with XP theme??

Hi,

I've succeeded (almost) in creating a ListView with XP theme by messing
with the manifest file.

I have a question ....

How do I get the first column to be gray and all other columns to be
white (like in the explorer)??

Thanks!

M O J O



Fri, 15 Apr 2005 17:02:26 GMT  
 ListView with XP theme??
public const uint LVM_FIRST = 0x1000;
public const uint LVM_SETSELECTEDCOLUMN = (LVM_FIRST + 140);

[DllImport("user32.dll")]
public extern static int SendMessage(IntPtr hWnd, uint msg, uint wParam,
uint lParam);

public int SelectedColumn
{
   set
   {
       SendMessage(this.Handle, LVM_SETSELECTEDCOLUMN, (uint)col, 0);
   }

Quote:
}

BL



Quote:
> Hi,

> I've succeeded (almost) in creating a ListView with XP theme by messing
> with the manifest file.

> I have a question ....

> How do I get the first column to be gray and all other columns to be
> white (like in the explorer)??

> Thanks!

> M O J O



Sat, 16 Apr 2005 04:39:34 GMT  
 ListView with XP theme??
Hi BL,

Thanks for answering my post!

Hmmm .... I'm trying to translate it to VB.Net without any luck.

If it's not to much to ask of you, is it possible that you can email me
a tiny solution with an example (in C.Net)???


Thanks!!!!!!!!!!!!

M O J O

Quote:

> public const uint LVM_FIRST = 0x1000;
> public const uint LVM_SETSELECTEDCOLUMN = (LVM_FIRST + 140);

> [DllImport("user32.dll")]
> public extern static int SendMessage(IntPtr hWnd, uint msg, uint wParam,
> uint lParam);

> public int SelectedColumn
> {
>    set
>    {
>        SendMessage(this.Handle, LVM_SETSELECTEDCOLUMN, (uint)col, 0);
>    }
> }

> BL



>>Hi,

>>I've succeeded (almost) in creating a ListView with XP theme by messing
>>with the manifest file.

>>I have a question ....

>>How do I get the first column to be gray and all other columns to be
>>white (like in the explorer)??

>>Thanks!

>>M O J O



Sat, 16 Apr 2005 05:37:53 GMT  
 ListView with XP theme??
*slapping my head*

Thanks!!!!!!

It works perfectly now.

I'm obviously not as good with a calculator than I thought.

:o)

M O J O

Quote:

> You have Public Const LVM_FIRST = 1750, it's supposed to be 0x1000 which is
> 4096 decimal.

> BL



>>Hi BL,

>>Well I can't make it work. I just wanted to see it work in a C solution,
>>that way I might better convert it to VB.Net.

>>I know you can't help me with my VB solution, but for others, here's my
>>solution so far (it's not working, I mean it's not making the first
>>column gray):

>>Public Class Form1
>>     Inherits System.Windows.Forms.Form

>>     ' Windows Form Designer generated code ... stuff.

>>     Private Declare Auto Function SendMessage Lib "User32" (ByVal hWnd _
>>       As IntPtr, ByVal msg As Integer, ByVal wParam As Integer, ByVal _
>>       lParam As Integer) As Integer
>>     Public Const LVM_FIRST = 1750
>>     Public Const LVM_SETSELECTEDCOLUMN = (LVM_FIRST + 140)

>>     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As _
>>       System.EventArgs) Handles MyBase.Load
>>         SendMessage(ListView1.Handle, LVM_SETSELECTEDCOLUMN, 0, 0)
>>     End Sub

>>End Class

>>Any ideas?

>>Thanks.

>>M O J O


>>>I can't really help with porting this example to VB, the code is copied

> from

>>>one of my projects and it works fine.
>>>What's exactly the problem?

>>>BL



>>>>Hi BL,

>>>>Thanks for answering my post!

>>>>Hmmm .... I'm trying to translate it to VB.Net without any luck.

>>>>If it's not to much to ask of you, is it possible that you can email me
>>>>a tiny solution with an example (in C.Net)???

>>>>My email addy is mojo"at"newwebsolutions.dk, just replace "at" with an


>>>>Thanks!!!!!!!!!!!!

>>>>M O J O


>>>>>public const uint LVM_FIRST = 0x1000;
>>>>>public const uint LVM_SETSELECTEDCOLUMN = (LVM_FIRST + 140);

>>>>>[DllImport("user32.dll")]
>>>>>public extern static int SendMessage(IntPtr hWnd, uint msg, uint

> wParam,

>>>>>uint lParam);

>>>>>public int SelectedColumn
>>>>>{
>>>>>  set
>>>>>  {
>>>>>      SendMessage(this.Handle, LVM_SETSELECTEDCOLUMN, (uint)col, 0);
>>>>>  }
>>>>>}

>>>>>BL


>>>message


>>>>>>Hi,

>>>>>>I've succeeded (almost) in creating a ListView with XP theme by

> messing

>>>>>>with the manifest file.

>>>>>>I have a question ....

>>>>>>How do I get the first column to be gray and all other columns to be
>>>>>>white (like in the explorer)??

>>>>>>Thanks!

>>>>>>M O J O



Sat, 16 Apr 2005 21:47:42 GMT  
 ListView with XP theme??
You have Public Const LVM_FIRST = 1750, it's supposed to be 0x1000 which is
4096 decimal.

BL



Quote:
> Hi BL,

> Well I can't make it work. I just wanted to see it work in a C solution,
> that way I might better convert it to VB.Net.

> I know you can't help me with my VB solution, but for others, here's my
> solution so far (it's not working, I mean it's not making the first
> column gray):

> Public Class Form1
>      Inherits System.Windows.Forms.Form

>      ' Windows Form Designer generated code ... stuff.

>      Private Declare Auto Function SendMessage Lib "User32" (ByVal hWnd _
>        As IntPtr, ByVal msg As Integer, ByVal wParam As Integer, ByVal _
>        lParam As Integer) As Integer
>      Public Const LVM_FIRST = 1750
>      Public Const LVM_SETSELECTEDCOLUMN = (LVM_FIRST + 140)

>      Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As _
>        System.EventArgs) Handles MyBase.Load
>          SendMessage(ListView1.Handle, LVM_SETSELECTEDCOLUMN, 0, 0)
>      End Sub

> End Class

> Any ideas?

> Thanks.

> M O J O


> > I can't really help with porting this example to VB, the code is copied
from
> > one of my projects and it works fine.
> > What's exactly the problem?

> > BL



> >>Hi BL,

> >>Thanks for answering my post!

> >>Hmmm .... I'm trying to translate it to VB.Net without any luck.

> >>If it's not to much to ask of you, is it possible that you can email me
> >>a tiny solution with an example (in C.Net)???


> >>Thanks!!!!!!!!!!!!

> >>M O J O


> >>>public const uint LVM_FIRST = 0x1000;
> >>>public const uint LVM_SETSELECTEDCOLUMN = (LVM_FIRST + 140);

> >>>[DllImport("user32.dll")]
> >>>public extern static int SendMessage(IntPtr hWnd, uint msg, uint
wParam,
> >>>uint lParam);

> >>>public int SelectedColumn
> >>>{
> >>>   set
> >>>   {
> >>>       SendMessage(this.Handle, LVM_SETSELECTEDCOLUMN, (uint)col, 0);
> >>>   }
> >>>}

> >>>BL


> > message


> >>>>Hi,

> >>>>I've succeeded (almost) in creating a ListView with XP theme by
messing
> >>>>with the manifest file.

> >>>>I have a question ....

> >>>>How do I get the first column to be gray and all other columns to be
> >>>>white (like in the explorer)??

> >>>>Thanks!

> >>>>M O J O



Sat, 16 Apr 2005 22:18:09 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. XP Theme

2. Enummerate XP themes parts and states??

3. Will .Net framework ever support XP themes?

4. XP Themes

5. XP Themes and HelpProvider1?

6. XP Themes

7. XP Theme API wrapper?

8. Windows XP themes

9. XP Theme

10. Forcing app to ignore XP theme?

11. VB6 + MSCOMCTL.OCX = no XP themes??

12. Common Control & Win XP Themes

 

 
Powered by phpBB® Forum Software