Solved

Checkbox List

Posted on 1998-07-24
7
194 Views
Last Modified: 2010-05-03
I want to present the user with a list of checkboxes (as used in some installers for selecting install options). It must be able to accomodate an arbitrary numer of items. I know I could create some pictureboxes and make new check boxes within one of them as needed, and put up scroll bars if needed, but if someone has done it before, which I'm sure someone has, then it's no reason for me to do it again...

Regards,
   MacSverre
0
Comment
Question by:MacSverre
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 2

Author Comment

by:MacSverre
ID: 1466601
Edited text of question
0
 
LVL 1

Expert Comment

by:web_crusher
ID: 1466602
you are missing the whole point of this site - you need to learn and listen
and not getting easy answers

what you want is easy to do - open help and look under checkbox - great examples

dont wait for someone to write it for u - write it yorself
0
 
LVL 2

Author Comment

by:MacSverre
ID: 1466603
Ehm... If you look at my previous questions, I think you'll see that I'm not looking for "easy answers"... Maybe you're using VB5 - I've heard that the VB5 "list" control includes a checkbox option, but I'm using VB4, because there needs to be a 16-bit version of the program. Also, in VB4 there are no examples for the checkbox control...

What I want to do here is not all that easy. I know _one_ way to do it, which is to make two picture boxes within each other, make the necessary text boxes within the inner picture box, resize the inner picture box to accomodate the checkboxes, and - for when the inner picture box becomes bigger than the outer - have scrollbars to move the inner picture box around in the outer picture box. But this will take quite a bit of time and coding, and it would be much better to have a ready-made solution, which is tried and tested...

And in case I haven't made it clear enough; I don't _know_ how many items (that is, checkboxes) will be used - that is decided at run time.



Regards

   MacSverre
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Author Comment

by:MacSverre
ID: 1466604
Ooops... In my last comment, I meant to say "make the necessary _check_ boxes", not "text boxes"...

Sorry!



   MacSverre
0
 
LVL 9

Accepted Solution

by:
cymbolic earned 100 total points
ID: 1466605


Basically, here's how you do it.  Create a check box control on your form. Copy it an paste it back again, and say yes, you want to create a control array.  Then delete the second text box.

Then at run time, you can load another checkbox, set its properties, and move it where you want tit at run time, based upon whatever program criteria determinse the numbe of checkboxes you need.  Heres an example of doing just that with a text box control:

Private Sub label_DblClick(Index As Integer)
 Dim I
 I = MaxTexts + 1
 Load Text(I)
 Text(I).Text = label(Index).Caption
 Text(I).Move label(Index).Left, label(Index).Top, label(Index).Width
 Text(I).Visible = True
 Text(I).tag = Format$(Index)
 Text(I).SetFocus
End Sub

Then, later on if you don't need it you can:

  Unload Text(Index)

works the same with checkboxes, only the properties are different.
0
 
LVL 1

Expert Comment

by:web_crusher
ID: 1466606
you've just had to clear things out at your question!
sorry - i just see a lot of members who wants only the code and
not the way to do things!!
0
 
LVL 2

Author Comment

by:MacSverre
ID: 1466607
I really wanted the code for a complete "checkbox list", but it doesn't seem like I'll get it, so I'll just have to roll my own...

web_crusher: Sorry I wasn't specific enough... I (obviously) thought I were. I understand your concern... :-)



Regards,

   MacSverre



P.S. I'm still interested in "the works". So if anyone has it, just add a comment, and I'll open a new question for you...
0

Featured Post

Want Experts Exchange at your fingertips?

With Experts Exchange’s latest app release, you can now experience our most recent features, updates, and the same community interface while on-the-go. Download our latest app release at the Android or Apple stores today!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month6 days, 19 hours left to enroll

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question