-
Apr 16th, 2011, 12:29 PM
#1
Thread Starter
Lively Member
Rendering ListView using Windows Vista Styles
Hi.
When I was use the ListView, i want to skin this control. I searched many sources and i found the solution. This solution based on the NickThissen's "ListView Options screen" code. Here you can find it: http://www.vbforums.com/showthread.php?p=3385557
The Code
Code:
'// Call Interop Services
Imports System.Runtime.InteropServices
'// Enable Vista Theming for ListView
<DllImport("uxtheme", CharSet:=CharSet.Unicode)> _
Public Shared Function SetWindowTheme(ByVal hWnd As IntPtr, ByVal textSubAppName As String, ByVal textSubIdList As String) As Integer
End Function
'// Add This Code to Form_Load (ListView1, enter your listview control name)
SetWindowTheme(ListView1.Handle, "explorer", Nothing)
Preview
-
Apr 16th, 2011, 08:30 PM
#2
Re: Rendering ListView using Windows Vista Styles
-
Apr 18th, 2011, 11:26 AM
#3
Re: Rendering ListView using Windows Vista Styles
Nice one.
There already was a codebank thread about this here but that's ok I guess, your example shows the effect nicely too
And as you can see, it also works on the TreeView!
-
Apr 18th, 2011, 02:23 PM
#4
Thread Starter
Lively Member
Re: Rendering ListView using Windows Vista Styles
-
Jan 31st, 2013, 10:28 PM
#5
Member
Re: Rendering ListView using Windows Vista Styles
can i do this effect in vb6. i like the highlighter of the item in your listview
-
Feb 1st, 2013, 12:09 AM
#6
Member
Re: Rendering ListView using Windows Vista Styles
i try this in vb6 . doesnt work
-
Feb 1st, 2013, 10:39 AM
#7
Re: Rendering ListView using Windows Vista Styles
Originally Posted by adrian1207
i try this in vb6 . doesnt work
This is the CodeBank for .Net, so the code in this thread is assumed to not work with vb6. That being said, I'm sure you could come up with something similar in vb6 if you wanted but it would be up to you to do, or you could forget vb6 considering it's 15 years old.
-
Feb 1st, 2013, 11:00 AM
#8
Member
Re: Rendering ListView using Windows Vista Styles
Originally Posted by JuggaloBrotha
This is the CodeBank for .Net, so the code in this thread is assumed to not work with vb6. That being said, I'm sure you could come up with something similar in vb6 if you wanted but it would be up to you to do, or you could forget vb6 considering it's 15 years old.
i try this code .which is similar to this code but it doesn't work ...
Private Declare Function SetWindowTheme Lib "uxtheme.dll" (ByVal hwnd As Long, ByVal pszSubAppName As Long, ByVal pszSubIdList As Long) As Long
Private Sub Form_Load()
Call SetWindowTheme(ListView1.hwnd, StrPtr("explorer"), 0)
'Call SetWindowTheme(TreeView1.hwnd, StrPtr("explorer"), 0)
ListView1.SmallIcons = ilRecordIco
a = ListView1.ListItems.Add(, , "asd" & vbNewLine & "asd", 1, 1)
End Sub
-
Feb 1st, 2013, 11:32 AM
#9
Re: Rendering ListView using Windows Vista Styles
Originally Posted by adrian1207
i try this code .which is similar to this code but it doesn't work ...
Private Declare Function SetWindowTheme Lib "uxtheme.dll" (ByVal hwnd As Long, ByVal pszSubAppName As Long, ByVal pszSubIdList As Long) As Long
Private Sub Form_Load()
Call SetWindowTheme(ListView1.hwnd, StrPtr("explorer"), 0)
'Call SetWindowTheme(TreeView1.hwnd, StrPtr("explorer"), 0)
ListView1.SmallIcons = ilRecordIco
a = ListView1.ListItems.Add(, , "asd" & vbNewLine & "asd", 1, 1)
End Sub
You might want to ask in the vb6 forum here, I don't know about other .Net developers here but I haven't used vb6 in over 7 years now and haven't a clue how things are done in it anymore.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|