Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
GT GT is offline
external usenet poster
 
Posts: 1
Default Editable listbox?

Hello all,

I want to have a control which is something like the "Properties
Window", i.e the first column's fields are fixed but the second column's
fields are editable.

The data for the first column is populated by the user selecting a range
of data from a spreadsheet (via a refedit) so it can vary in size. The
second column is initially populated with a default value that the user
can override.

I'm not a particularaly experienced VB programmer so I have probably
missed some obvious control out there that's ideal for the job.

Anyway, the closest I've come to this solution is by trying to
dynamically create a "table" from labels (for the 1st column) and
text-boxes (for the 2nd column) but I dont seem to get any events for
the dynamic controls.

I looked into the DBGrid but this doesn't seem to be what I want either.

It's probably worth mentioning it's Excel97 on Win2k

If anybody out there can point me in the direction of a suitbale control
I'd be very grateful.

TIA
G

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 595
Default Editable listbox?

G

I can't think of a control that does just what you want. You could use a
two column listbox, but you wouldn't be able to edit directly in the
listbox. You could have the user select an entry, then click a button to
change the value. The button would show an InputBox where the user could
type in the value. If you need help with the code for that, post back.

Actually, I like the label/textbox table idea. What you need to do is
determine the maximum number of entries there could be and create a
label/textbox pair for each of those. Change the visible property of those
controls to False so they are invisible. Set up all your event code for the
textboxes. Then, when you're ready to populate the controls (presumably in
the Initialize event), set the Visible property to True for only the
controls that you'll need. The other controls will still be there, but the
user won't be able to see them or trigger any of there events.

Setting up the controls at design-time will make your form run faster and
allow you to create the events more easily than creating them on the fly.
Your only challenge may be resizing the userform so you don't have a bunch
of blank space, but that's definitely doable and still easier than creating
them on the fly. I guess the key may be how well you can predict the
maximum number of label/textbox pairs you will need.

If you have follow up questions, be sure to post back.

--
Dick Kusleika
MVP - Excel
Excel Blog - Daily Dose of Excel
www.dicks-blog.com

"GT" wrote in message
...
Hello all,

I want to have a control which is something like the "Properties
Window", i.e the first column's fields are fixed but the second column's
fields are editable.

The data for the first column is populated by the user selecting a range
of data from a spreadsheet (via a refedit) so it can vary in size. The
second column is initially populated with a default value that the user
can override.

I'm not a particularaly experienced VB programmer so I have probably
missed some obvious control out there that's ideal for the job.

Anyway, the closest I've come to this solution is by trying to
dynamically create a "table" from labels (for the 1st column) and
text-boxes (for the 2nd column) but I dont seem to get any events for
the dynamic controls.

I looked into the DBGrid but this doesn't seem to be what I want either.

It's probably worth mentioning it's Excel97 on Win2k

If anybody out there can point me in the direction of a suitbale control
I'd be very grateful.

TIA
G

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
un-editable nightblade Excel Discussion (Misc queries) 0 July 18th 07 12:36 AM
Editable Combobox? crapit Excel Programming 0 July 6th 04 07:34 PM
Non-Editable ComboBox? NooK Excel Programming 3 June 17th 04 04:30 PM
listbox.value not equal to listbox.list(listbox.listindex,0) ARB Excel Programming 0 October 22nd 03 12:46 AM
Is refreshing listbox rowsource in listbox click event possible? Jeremy Gollehon[_2_] Excel Programming 4 September 25th 03 06:45 PM


All times are GMT +1. The time now is 07:32 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"