Results 1 to 5 of 5

Thread: Graphical button

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2000
    Location
    Thessaloniki ,Greece
    Posts
    100

    Angry

    Hi...
    Did anyone know how can i make a button with a picture and in this picture how can i put a transper area.
    I dont want the "Usemaskcolor" property.
    I want a button to make the mouse in and mouse out events in proportion of colored mask make to be true or false
    I dont know if you can unterstant me.
    I just want a button with graphical face and to click on it
    in proportion of an colored mask.

  2. #2
    Fanatic Member kinjalgp's Avatar
    Join Date
    Apr 2000
    Location
    India
    Posts
    535

    Talking

    I know it but can you please wait for 6 to 7 hours b'coz at preesent I'm going to college to give exams. I will post the code as soon as I come back.
    At present the time is 8:51 AM here and the date is 4/5/2000.

    Kinjal

  3. #3
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    do you want my ocx or do you want me to explain how to make your own?
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  4. #4
    Fanatic Member kinjalgp's Avatar
    Join Date
    Apr 2000
    Location
    India
    Posts
    535

    Talking

    Hi! I am back!
    Here is the code for graphical button whose color changes when an event like click occurs and on the next click the color changes back to what it was previously.

    To Start with:
    --------------
    First place a Timer control and one text box on the form. Then put any shape on the form you desire like rounded rectangle which I 've used in this example. On the same position place an image box and one label. Set the BackStyle property of the label to Transparent and Caption to whatever name you desire to give to the button.

    Note: Imagebox,Label and the shape should be overlapping each other.

    Code:
    -----

    Gereral declarations:
    ---------------------
    Public Img1 As Boolean
    Dim a, b As Integer
    ------------------------------------------------------------
    Private Sub Form_Load()
    Shape1.FillColor = RGB(155, 0, 0)
    End Sub
    ------------------------------------------------------------
    Private Sub Image1_Click()
    If Img1 = False Then
    Text1.Text = "Hello Everybody !"
    Timer1.Enabled = True
    Img1 = True
    Else
    Text1.Text = ""
    Timer1.Enabled = True
    Img1 = False
    End If
    End Sub
    ------------------------------------------------------------
    Private Sub Timer1_Timer()
    a = a + 1
    b = b + 1

    If Img1 = True Then
    Shape1.FillColor = RGB(155 + (a * 10), 0, 0)
    Else
    Shape1.FillColor = RGB(255 - (b * 10), 0, 0)
    End If
    If a > 10 Or b > 10 Then
    Timer1.Enabled = False
    a = 0
    b = 0
    End If

    End Sub

    Hope I understood your question and this is what you needed . You can also modify this code to make the buttons more graphical. Still if you don't understand the code give me your Email Add. I'll send you the example which I prepared for you.

    Good luck!

    Kinjal

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jan 2000
    Location
    Thessaloniki ,Greece
    Posts
    100

    For Kedaman

    Kedaman

    If you can send the ocx file in [email protected]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width