473,327 Members | 1,979 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,327 software developers and data experts.

Scrolling list of user controls (and more)


Hello again,

I have a problem that I can't seem to find any help for. I'm probably not typing the
correct words into goo... *cough*... MSN.

I have created a user control which I would like to use as items in a list. The list would
display as many of these controls as I wish to add, scrolling as it needs to.

I KNOW this functionality exists already in every list you care to mention but I don't
know how to go about making a list display my user control rather than a string as
seems to often be the case.

Anyone help?

------------------------------------

Another unchecked rambeling brought to you by:

Oddball
joshua@bf#N0SP4M#wd.co.uk
Nov 17 '05 #1
3 5218
Dear Oddball,

This might help : (from MSDN)

Typically, Windows handles the task of drawing the items to display in the
ListBox. You can use the DrawMode property and handle the MeasureItem and
DrawItem events to provide the ability to override the automatic drawing
that Windows provides and draw the items yourself. You can use owner-drawn
ListBox controls to display variable-height items, images, or a different
color or font for the text of each item in the list. The HorizontalExtent
property, GetItemHeight, and GetItemRectangle property also provide
assistance for drawing your own items.
Possibly better would be a Listview in Detail mode. I've been using a
control that 'merges' a tree view and a list view
(http://www.codeproject.com/cs/miscct...elistview.asp). That could be a
useful starting point for your needs, though I should warn you that I had to
make quite a few minor fixes before it behaved as I wanted; I hope to post
them back to the site at some point. That uses the Listview to draw the text
and some images, but then draws additional stuff itself, using the
SetIndentation to make space (note - Indentation is based on image width, so
no ImageList, no indentation). It also uses BeforeLabelEdit and
AfterLabelEdit to change the editing Textbox to a Combobox, or similar,
during editing.
Failing that, could you create a scrollable control and handle other
drawing, user input, etc. yourself?
HTH - feels like a single post from me is enough to kill a thread, so sorry
if that happens!!!! ;o)

Now, if I could just get an answer to my scrolling problem ('Scrolling bug
in MDI client windows') I'd be a happy guy...

James

Nov 17 '05 #2

Questions as vague as the one I asked usualy don't get ANY replies, I'm happy with
just one... I'll give it a coat of looking at.

"James CC" <Ja*****@Nowhere.com> wrote:
Dear Oddball,

This might help : (from MSDN)

Typically, Windows handles the task of drawing the items to display in the
ListBox. You can use the DrawMode property and handle the MeasureItem and
DrawItem events to provide the ability to override the automatic drawing
that Windows provides and draw the items yourself. You can use owner-drawn
ListBox controls to display variable-height items, images, or a different
color or font for the text of each item in the list. The HorizontalExtent
property, GetItemHeight, and GetItemRectangle property also provide
assistance for drawing your own items.
Possibly better would be a Listview in Detail mode. I've been using a
control that 'merges' a tree view and a list view
(http://www.codeproject.com/cs/miscct...elistview.asp). That could be a
useful starting point for your needs, though I should warn you that I had to
make quite a few minor fixes before it behaved as I wanted; I hope to post
them back to the site at some point. That uses the Listview to draw the text
and some images, but then draws additional stuff itself, using the
SetIndentation to make space (note - Indentation is based on image width, so
no ImageList, no indentation). It also uses BeforeLabelEdit and
AfterLabelEdit to change the editing Textbox to a Combobox, or similar,
during editing.
Failing that, could you create a scrollable control and handle other
drawing, user input, etc. yourself?
HTH - feels like a single post from me is enough to kill a thread, so sorry
if that happens!!!! ;o)

Now, if I could just get an answer to my scrolling problem ('Scrolling bug
in MDI client windows') I'd be a happy guy...

James

------------------------------------

Another unchecked rambeling brought to you by:

Oddball
joshua@bf#N0SP4M#wd.co.uk
Nov 17 '05 #3
Dear Oddball,

For the TreeListView, the author catches windows messages to know when to
paint, etc. You could no doubt do the same.

By the way, whats a 'coat of looking at'??

Either way, you now have two replies....

James
Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: headware | last post by:
I have a <select> control that contains many entries. It allows the user to multi-select a group of them, click a button, and store the selected data in a database. Normally they do this starting...
13
by: al jones | last post by:
I guess one question at a time will work better. URL http://aljones.us (yes, I'm back again) I'd like to cause this whole page to fill the viewable window if I can. Meaning that I'd like the...
5
by: Vigneshwar Pilli via DotNetMonster.com | last post by:
string connectionString1 = "server=(local); user=sa;password=sa; database=sonic"; System.Data.SqlClient.SqlConnection dbConnection1 = new System.Data.SqlClient.SqlConnection(connectionString1);...
1
by: Oberfuhrer | last post by:
Hello all VB.net friends ! i have done most of my programming in assembly, at least so far. Recently i decided to learn a high level language for windows programming. I didnt take long to...
1
by: atif | last post by:
Hi, I m new to CSharp.. so may be my preliminary questions look stupid.. but plz help me.. I want to drag controls like buttons or some other user controls over form.. i have set form's...
2
by: Rob Pollard | last post by:
Hi All, I am using the flow control (can't remember its full name), to display a few dynamically created controls based on the tags the user has added to my system. This works fine, except when a...
3
by: j0rd4n | last post by:
I have a user control that needs to allow vertical scrolling but not horizontal scrolling. In the user control's resize event, I need to adjust the size of all the children controls. For this to...
11
by: =?Utf-8?B?UmF5IE1pdGNoZWxs?= | last post by:
Hello, I know I sound like a one-note Johnny on this but I'm still looking for a solution. I need to display characters coming in from a serial port or a socket. I also need to be able to type...
7
by: robert.waters | last post by:
I have an Access database frontend linked via ODBC to a large (gigabytes) mysql database. I need to view a large amount of data in a a textbox (variable up to 300K), but I receive a 'there isnt...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.