|
-
Jul 6th, 2000, 09:08 AM
#1
Thread Starter
Fanatic Member
Like in word/wordpad for bold,italic,underline etc. I want to click a button and have it stay down (a boolean set) till it is clicked again. So I need it indented.
I could write my own control but surely there's a short cut!!!
back to sleep
zzzzzzzzzzzzzzzzzzzzzz
Paul Dwyer 
Network Engineer
Aussie In Tokyo
Using Powerbasic 6 & VB6 SP4 (Please also add your VB Version to your signature!)
-
Jul 6th, 2000, 09:13 AM
#2
You can use the toolbar control, where the buttons have a pressed/unpressed property that you can control thru code.
"It's cold gin time again ..."
Check out my website here.
-
Jul 6th, 2000, 09:14 AM
#3
Or you can use a CheckBox and set it's Style property to Graphical.
-
Jul 6th, 2000, 09:17 AM
#4
Member
Maybe it's my turn,...
To do this, my idea is to paint your own button. I explain:
You take a CommandButton (Classic VB control), and you set it's Style property to Graphical. You need two Graphical files:
one will represent the button activate,
the other one, the button inactivate.
With a boolean, you just have to switch between the two graphical file.
I hope it will help you, talk to you soon.
-
Jul 6th, 2000, 09:27 AM
#5
Lively Member
you can use an Img Button. When you click on the image it will act as a button.
Following is some code I did for work in access. It is in VB.
Sub ToggleUIButtons(intCurrButton As Integer)
Static intLastClicked As Integer
If intCurrButton <> intLastClicked Then
intLastClicked = intCurrButton
imgAppt.SpecialEffect = 0
Select Case intCurrButton
Case 2
imgAppt.SpecialEffect = 1
End Select
intCurrButton = intLastClicked
End If
End Sub
This Sub makes the button look depressed. Has to do with the "specialeffect" property. If this helps or you need more let me know.
VB 6 Professional Edition
-
Jul 6th, 2000, 09:30 AM
#6
Thread Starter
Fanatic Member
Toolbar... Does that work vertically? like down the left hand side of a form?
Checkbox graphical??? what's that look like? Now I know why they made you a guru! never done that before.
The image options I know will work but I was just wondering if there was a "normal" way, if there is such a thing... Let me have a look at the checkbox...
Paul Dwyer 
Network Engineer
Aussie In Tokyo
Using Powerbasic 6 & VB6 SP4 (Please also add your VB Version to your signature!)
-
Jul 6th, 2000, 09:33 AM
#7
Thread Starter
Fanatic Member
Meg, You're a legend! I had no idea that a check box does that!!!!
Let me $$$$ your #### 
(I've been censored a lot lately so I'm watching my vocab!)
Paul Dwyer 
Network Engineer
Aussie In Tokyo
Using Powerbasic 6 & VB6 SP4 (Please also add your VB Version to your signature!)
-
Jul 6th, 2000, 09:40 AM
#8
You can also do the same with OptionButtons. They will appear as Buttons that work in Groups (Like the Alignment buttons).
-
Jul 6th, 2000, 09:42 AM
#9
Paul -
You seem to be settled on these other options, but yes, the toolbar can be aligned vertically on the left-hand side of a form. If you haven't used it before, its part of the Microsoft Windows Common Controls (out of Project -> Components) - it is in the same group as the TreeView, ListView, StatusBar, ImageList, etc. It works in conjunction with the ImageList, where you store the images for your toolbar buttons.
"It's cold gin time again ..."
Check out my website here.
-
Jul 6th, 2000, 09:42 AM
#10
Member
Very funny your post Paul282 !!
-
Jul 6th, 2000, 09:54 AM
#11
Thread Starter
Fanatic Member
Originally posted by BruceG
Paul -
You seem to be settled on these other options, but yes, the toolbar can be aligned vertically on the left-hand side of a form. If you haven't used it before, its part of the Microsoft Windows Common Controls (out of Project -> Components) - it is in the same group as the TreeView, ListView, StatusBar, ImageList, etc. It works in conjunction with the ImageList, where you store the images for your toolbar buttons.
I'll check that too. I have used the toolbar but only once and very basically. I don't normally make apps to pass out to every day users, just tools for other engineers in my team.
THX
Paul Dwyer 
Network Engineer
Aussie In Tokyo
Using Powerbasic 6 & VB6 SP4 (Please also add your VB Version to your signature!)
-
Jul 6th, 2000, 11:13 AM
#12
_______
<<?>> Walk Aroung..Looks Good (to me...)
'this really looks too cool...
'can't get it to work with the normal button look but
'if I use the sunken 3d effect and call it to set it
'looks really really good...sunken and stays sunken.
'to view it copy and paste this code.
'Form1 Command1
'
Option Explicit
Public PixX, PixY, CTop, Clft, CRgt, CBtm, i, AddX, AddY
Public nowDown As Boolean
Public Sub ThreeDControl(Ctrl As _
Control, nBevel, nSpace, bInset)
PixX = Screen.TwipsPerPixelX
PixY = Screen.TwipsPerPixelY
CTop = Ctrl.Top - PixX
Clft = Ctrl.Left - PixY
CRgt = Ctrl.Left + Ctrl.Width
CBtm = Ctrl.Top + Ctrl.Height
' Color used below:
' dark gray = &H808080
' white = &HFFFFFF
If bInset Then 'inset border
For i = nSpace To (nBevel + nSpace - 1)
AddX = i * PixX
AddY = i * PixY
Ctrl.Parent.Line (Clft - AddX, CTop - _
AddY)-(CRgt + AddX, CTop - AddY), &H808080
Ctrl.Parent.Line (Clft - AddX, CTop - _
AddY)-(Clft - AddX, CBtm + AddY), &H808080
Ctrl.Parent.Line (Clft - AddX, CBtm + _
AddY)-(CRgt + AddX + PixX, CBtm + AddY), &HFFFFFF
Ctrl.Parent.Line (CRgt + AddX, CTop - _
AddY)-(CRgt + AddX, CBtm + AddY), &HFFFFFF
Next
Else 'outset border
For i = nSpace To (nBevel + nSpace - 1)
AddX = i * PixX
AddY = i * PixY
Ctrl.Parent.Line (CRgt + AddX, CBtm + _
AddY)-(CRgt + AddX, CTop - AddY), &H808080
Ctrl.Parent.Line (CRgt + AddX, CBtm + _
AddY)-(Clft - AddX, CBtm + AddY), &H808080
Ctrl.Parent.Line (CRgt + AddX, CTop - _
AddY)-(Clft - AddX - PixX, CTop - AddY), &HFFFFFF
Ctrl.Parent.Line (Clft - AddX, CBtm + _
AddY)-(Clft - AddX, CTop - AddY), &HFFFFFF
Next
End If
End Sub
Private Sub Command1_Click()
If nowDown = False Then
Call ThreeDControl(Command1, 1, 0, True)
Command1.Width = 1215
Command1.Height = 495
nowDown = True
Else
nowDown = False
Command1.Width = 1250
Command1.Height = 525
Command1.Refresh
End If
End Sub
Private Sub Form_Activate()
Call ThreeDControl(Command1, 1, 0, True)
Command1.Width = 1215
Command1.Height = 495
nowDown = True
Call Command1_Click
End Sub
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
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
|