• Welcome to Valhalla Legends Archive.
 

ListView question

Started by iNsaNe, October 03, 2008, 06:46 PM

Previous topic - Next topic

iNsaNe

This has somewhat to do with bot development

What properties do I need to set to have my listview display one user (item) per line, have vertical scrollbars ONLY, and have a second column (not sure if it actually is another column) that shows another image (example: latency)

(so that it looks like the Starcraft channel list)

MyndFyre

You'd want to use owner-drawn listviews.

http://msdn.microsoft.com/en-us/library/system.windows.forms.listview.drawitem(VS.80).aspx

I personally use a ListBox instead of a ListView but it's a matter of preference.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

iNsaNe

Thanks lol but one last question, sort of a beginner question too.

How do I make it so when I scroll the listbox (I changed to a listbox, you are right it is much easier) the images dont flicker. Like microsoft said, override DoubleBuffer but I'm not sure how? I'm doing this in C#

MyndFyre

listBox.DoubleBuffered = true;
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

brew

#4
Override double buffering? It's never enabled by default. You'd have to either send an LVM_SETEXTENDEDLISTVIEWSTYLE message with LVS_EX_DOUBLEBUFFER as the style and mask, or (i guess) do it the way myndfyre said.

To display a listview the way starcraft does is extremely simple. Use the style LVS_REPORT | LVS_NOCOLUMNHEADER | LVS_SINGLESEL, and set LVS_EX_SUBITEMIMAGES as well (yes, it is a seperate column).
If you want your listview to have no horizontal scroll bar, check out ShowScrollBar().

Really, you should stick with a listview. It makes for less work and a more professional looking application in the end.
<3 Zorm
Quote[01:08:05 AM] <@Zorm> haha, me get pussy? don't kid yourself quik
Scio te esse, sed quid sumne? :P

l)ragon

As I remember the latest (going from when I last looked) listview control you can only have 1 image in the inital column and thats all, I remember haveing to build my own controll for my user list.
if I ever get back into this sort of crap again ill probably go with the listbox also.
*^~·.,¸¸,.·´¯`·.,¸¸,.-·~^*ˆ¨¯¯¨ˆ*^~·.,l)ragon,.-·~^*ˆ¨¯¯¨ˆ*^~·.,¸¸,.·´¯`·.,¸¸,.-·~^*

MyndFyre

Quote from: brew on October 04, 2008, 07:11 AM
Override double buffering? It's never enabled by default. You'd have to either send an LVM_SETEXTENDEDLISTVIEWSTYLE message with LVS_EX_DOUBLEBUFFER as the style and mask, or (i guess) do it the way myndfyre said.

To display a listview the way starcraft does is extremely simple. Use the style LVS_REPORT | LVS_NOCOLUMNHEADER | LVS_SINGLESEL, and set LVS_EX_SUBITEMIMAGES as well (yes, it is a seperate column).
If you want your listview to have no horizontal scroll bar, check out ShowScrollBar().

Really, you should stick with a listview. It makes for less work and a more professional looking application in the end.
This is the .NET forum.  Everything you described in this post has object-oriented APIs in .NET.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

brew

Quote from: MyndFyre[vL] on October 05, 2008, 03:25 AM
This is the .NET forum.  Everything you described in this post has object-oriented APIs in .NET.
So you mean a .NET developer can't use the powerful Win32 API just as well, or is less effective when using it? That must suck.
<3 Zorm
Quote[01:08:05 AM] <@Zorm> haha, me get pussy? don't kid yourself quik
Scio te esse, sed quid sumne? :P

l)ragon

Quote from: brew on October 05, 2008, 07:35 AM
Quote from: MyndFyre[vL] on October 05, 2008, 03:25 AM
This is the .NET forum.  Everything you described in this post has object-oriented APIs in .NET.
So you mean a .NET developer can't use the powerful Win32 API just as well, or is less effective when using it? That must suck.
Can use Win32 as much as we want, he's trying to tell you everything can mostly be done otherways in .NET.
*^~·.,¸¸,.·´¯`·.,¸¸,.-·~^*ˆ¨¯¯¨ˆ*^~·.,l)ragon,.-·~^*ˆ¨¯¯¨ˆ*^~·.,¸¸,.·´¯`·.,¸¸,.-·~^*

Barabajagal

Brew likes reinventing the wheel.

Dale


brew

<3 Zorm
Quote[01:08:05 AM] <@Zorm> haha, me get pussy? don't kid yourself quik
Scio te esse, sed quid sumne? :P