|
-
Jan 26th, 2006, 04:02 PM
#1
[RESOLVED] How many combonations... best way to do this?
Ok I am creating an excel add-in... it has 6 options (checkboxes)
any combonation can be used (these turn on and off print options)
I want to make the toolbar button display an image representing whats turned on / off...
I need to know How many combonations are possible with 6 checkboxes? (No value of 2 (greyed) allowed .. so it will be just 1/0)
is it 27 combos? or am I waaay off? my brain is shot right now! lol
but what would be the best way to figure out which button pic to use?
I am thinking.. each checkbox TAG will have a 1 or 0, then build a string..
111010 and name the image in the res file accordingly?
sound good?
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Jan 26th, 2006, 04:06 PM
#2
Re: How many combonations... best way to do this?
2^6 I think, (64).
I am thinking.. each checkbox TAG will have a 1 or 0, then build a string..
111010 and name the image in the res file accordingly?
sound good?
Sounds like a good idea
Last edited by jcis; Jan 26th, 2006 at 04:14 PM.
-
Jan 26th, 2006, 04:24 PM
#3
Re: How many combonations... best way to do this?
Lol.. yeah I just tried this:
VB Code:
For a = 0 To 1
For b = 0 To 1
For c = 0 To 1
For d = 0 To 1
For e = 0 To 1
For f = 0 To 1
Debug.Print a & b & c & d & e & f
Next
Next
Next
Next
Next
Next
and I got 64 lines.. is that right? would I need to create 64 diff BMPS!???
or... is there some way to have a 16x16 picbox and "draw" smaller bmps onto it??
like I could have 2 bmps for each chkbox.. then when a checkbox is checked...
add or remove the bmp from the picbox?
hmm...
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Jan 26th, 2006, 04:36 PM
#4
Re: How many combonations... best way to do this?
If you want to draw them (it's a simple graphic?) it would be easy, but if you want to use bitmaps (from file or res file) maybe you could have only one bitmap (big bitmap) containing all mini bitmaps, then use PaintPicture to scrcopy the one you need each time.
-
Jan 26th, 2006, 04:40 PM
#5
Re: How many combonations... best way to do this?
Or you could use 2 bitmaps, one containing 6 "down" buttons and the other containing 1 "up" button. Then you paste the "up" button over the "down" button in the requisite places, which will be an integer number x the width of the "up" button picture according to the pattern of 1 and 0. Or you could actually do it in terms of a number:
1234 means paint the "up" button in positions 1,2,3 and 4.
256 means paint it in positions 2,5 and 6 etc
Or just use 6 togglebuttons...
zaza
-
Jan 26th, 2006, 04:48 PM
#6
Re: How many combonations... best way to do this?
Ok heres my thought
I have 2 images.. 1 on 1 off
they are in the RES file..
how do I load (or Draw) the little bmps into certain places in the picbox..
Picture1.Cls
Picture1.PaintPicture LoadResPicture("F_ON", vbResBitmap), 12, 2
doesnt error.. but nothing appeared in Picture1 ??
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Jan 26th, 2006, 04:50 PM
#7
Re: How many combonations... best way to do this?
.Scalemode = VbPixels? .AutoRedraw =True?
-
Jan 26th, 2006, 11:12 PM
#8
Re: How many combonations... best way to do this?
um no lol
It was working fine.. but I needed to use Picture2
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
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
|