|
-
Mar 26th, 2000, 09:47 PM
#1
Thread Starter
Hyperactive Member
Hi.
I have many forms in my project, each of which has about 15 command-button controls on them (an array). On each screen the buttons may have different text. At the moment they have their `picture` property set to include files from disk, but this is horrible, and anyway, i hate paint shop pro.
I`ve tried to overlay `label` controls over them, but they always appear underneath the command buttons. I`ve played with the command buttons `caption` and `font` properties, but cant change the colour. What i really want is something like
/________________\
!_______F2_______!
!________________!
!________________!
! make some tea !
!________________!
!________________!
\________________/
(closest i could get - the `preview` mode on this site is strange, and something is changing my chars...
then i could quickly change the text without poncing about in paintshoppro or whatever.
What methods could i use to change the font size/colour. I dont care if its at design time (preferred) or runtime. But i dont just want a few chars at the bottom of the button, in black, over a line which appears when you add a caption. (the `style` is graphical, not that horrible flat `standard` one).
Perplexed,
Alex.
-
Mar 26th, 2000, 09:53 PM
#2
Frenzied Member
use a checkbox with style set to Graphical
then reset it when clicked
Private Sub Check1_Click()
Check1.Value = 0
'
End Sub
-
Mar 26th, 2000, 10:22 PM
#3
Thread Starter
Hyperactive Member
well, the codes already done, theres already 10 or so forms with an array of 12 buttons on each one. changing them all to checkboxes would be a nightmare! and i dont want a checkbox anyway! you click on a button and it generally takes you to another form, or saves/prints etc. thats not a checkbox-relavent operation (i`d use them for `check out after check in` type choices) or am i missing the point of your suggestion here?
I just want to overlay text over the command buttons, seeing as i dont seem to have the flexibility to alter text colour/size using just the `caption` and `font` properties, and i dont want to have to dive into a graphics editor to change one word.
If there was some way of just printing text on a form at a given position i`d even use that! cos then all i`d have to do would be to work out the co-ordinate of the top left corner of each of the 12 buttons, once, and they`d be the same for each form. but i dont think you can do that - every `thing` has to be one control or another, and i tried superimposing a label but VB wasnt having it! it went behind the command button, even when i right clicked on it and sent it to the top.
Alex.
-
Mar 26th, 2000, 10:32 PM
#4
Frenzied Member
and i dont want a checkbox anyway!
with style set to Graphical it looks IDENTICAL to a command button but you can change the font colour etc.
-
Mar 26th, 2000, 11:04 PM
#5
Thread Starter
Hyperactive Member
!!!
i wrote `three` replies here, (and quite long ones at that) and just before i `sent` each one, i experimented a little more and found a solution.
ok, it looks like i`ll replace the arrays of command buttons with checkboxes, then load an image into it, which is just a more exaggurated 3d-wise version of an empty checkbox/command button. then stick a label control or 2 over it, so i can change the colour/text independantly of each other.
think that is about it for now! thanks for your help!
(pity you can get arrays of check-boxes...or can you? didnt prompt me in the way it does when you start playing with command buttons...)
Alex.
-
Mar 27th, 2000, 02:22 PM
#6
-
Mar 27th, 2000, 04:43 PM
#7
Thread Starter
Hyperactive Member
Well, i`m working to a vague spec... we`re not sure what the buttons will say, their colour/size etc, whether my part of the project should use the same font as the rest of the proje ct(which i dont have) etc... so it`ll be easier for now (and possibly compatible with the finished product) if i can overlay text over the buttons, rather than create images in a graphics package.
Yes, i worked out last night (where i`m not online) that you can have arrays of checkboxes! Thanks!
I`ve not found anything about VB that really annoys me yet. Just little things, like the inability to declare and initialize variables at the same time; the fact you cant have public constants in a form (have to be in a module); the fact that you can make checkboxes and command buttons act in very similar (exactly?) the same way but you cant put text over command buttons... Just inconsistancies really. It makes it un-orthagonal, and special-casey, to use at least one silly made up word. I find the online help either really useful, or pointless, too!
Thanks for your help!
Alex.
-
Mar 27th, 2000, 08:00 PM
#8
Thread Starter
Hyperactive Member
hmmm. not sure how i click on a checkbox button when most of it is covered by 3 textbox controls.
Quite apart from the fact that my program is getting `out of stack space` errors....hmmmm.
Maybe i`m stuck with command controls....cant you just overlay text without it being an object?
alex.
-
Mar 27th, 2000, 08:16 PM
#9
Frenzied Member
Are you using VB5 or VB6?
The help files for VB6 (msdn) are UTTER SHITE! and I didn't even bother to install them when I installed VB6 on my PC - having used it on another pc.
I still use the VB5 help files and have a short cut to vb5.hlp on my start menu.
-
Mar 27th, 2000, 08:49 PM
#10
Thread Starter
Hyperactive Member
er... VB6!!! 
you go `visual basic`...then you search for a word...half the things that show up as clickable (ie not belonging to j++, vss etc) are to do with something other than VB anyway!
And isnt something wrong when the whole thing is far slower than vc++1.52, which i use for legacy dos apps? There you highlight a word and hit f1 and BANG - theres the answer. You click on `sort` on VB6 help, and it takes about 1 min on a p2-333 to sort 500 items, which usually consist of only about 7 or 8 headings anyway! Hopeless!
I cant guarantee that the stack space problems arent something i did with the code...then again, all i did was to go through my code changing `Command` to `Check` (i did it reasonably carefully, and anyway, why would that cause stack problems?!).
And i cant see how to solve the `i cant click on labels` problem anyway...not without another 3 events per button....i dont have time for all this!!! It needs to be done NOW!! (know the feeling?!)
I`ll go back to using Command controls, only i`ll use one of the new checkboxes to enter the text, save the screen, use that instead.
I`ll come back to this though. Sometimes you just need (or want, dammit!) some text on the screen at an arbitrary position, but that doesnt respond to, or interfere with, any events at all...like a sort of overlay. A backdrop in front of everything...
Thanks for your help on this, anyway!
Alex.
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
|