[VB] Pictures! menu

User Tag List

Results 1 to 6 of 6
  1. #1
    Timzorize's Avatar Member
    Reputation
    9
    Join Date
    May 2008
    Posts
    206
    Thanks G/R
    1/0
    Trade Feedback
    0 (0%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    [VB] Pictures!

    Hey,

    I know how to make a button to a picture but I don't know how to make the button change picture when you left-click on it. Then I want to delete the Mouseover frame too, because if I put my mouse on the button it will be a gray ugly frame around the button which I don't want at all, I only want to change picture if you left-click on the button. (So the button is the picture actually)

    [VB] Pictures!
  2. #2
    SKU's Avatar Contributor
    Reputation
    306
    Join Date
    May 2007
    Posts
    565
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    Public Class Form1
    
        Dim counter As Integer = 0
        Dim MyPictures(3) As Bitmap
    
        ' OPTION ONE
        Private Sub Button1_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Button1.MouseDown
            If e.Button = Windows.Forms.MouseButtons.Right Then
                ' do other stuff..
            End If
            If e.Button = Windows.Forms.MouseButtons.Left Then
                ' change picture
            End If
        End Sub
    
        ' OPTION TWO
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            If counter > 2 Then
                counter = 0
            End If
    
            Button1.BackgroundImage = MyPictures(counter)
            counter = counter + 1
            ' and other stuff
        End Sub
    
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            MyPictures(0) = New Bitmap("<filepath for 1st pic>")
            MyPictures(1) = New Bitmap("<filepath for 2nd pic>")
            MyPictures(2) = New Bitmap("<filepath for 3rd pic>")
        End Sub
    End Class
    Cycles through the 3 pictures when left-clicked.

    For the mouse-over / border things. Try out the "FlatAppearance" and "FlatStyle" properties of your button.

    Good luck.

  3. #3
    Timzorize's Avatar Member
    Reputation
    9
    Join Date
    May 2008
    Posts
    206
    Thanks G/R
    1/0
    Trade Feedback
    0 (0%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    ^^

    But on

    Code:
            MyPictures(0) = New Bitmap("<filepath for 1st pic>")
            MyPictures(1) = New Bitmap("<filepath for 2nd pic>")
            MyPictures(2) = New Bitmap("<filepath for 3rd pic>")
    Should i put it like C:\Pictures\picture1.jpg? Imo that can't work if I send the program to someone else that not have the pictures on their computer? There must be a easier way just to make a mouseover image when you put the mouse over the image?
    Last edited by Timzorize; 01-20-2009 at 10:15 AM.

  4. #4
    j00nas's Avatar Member
    Reputation
    10
    Join Date
    Dec 2007
    Posts
    29
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Use resources to include the pictures in your project?

  5. #5
    Timzorize's Avatar Member
    Reputation
    9
    Join Date
    May 2008
    Posts
    206
    Thanks G/R
    1/0
    Trade Feedback
    0 (0%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by j00nas View Post
    Use resources to include the pictures in your project?
    I don't understand, I'm new at VB .NET

  6. #6
    ReidE96's Avatar Archer Authenticator enabled
    Reputation
    470
    Join Date
    Dec 2006
    Posts
    1,625
    Thanks G/R
    1/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How To Use Resources in Visual Basic .NET

    That should help you get started with using resources. It's a really good thing to learn to use, and actually quite simple.

Similar Threads

  1. Picture Thread (RL Pics)
    By warriorspwn in forum Community Chat
    Replies: 1827
    Last Post: 08-15-2024, 10:19 AM
  2. Picture guide to elwynn falls
    By KuRIoS in forum World of Warcraft Exploration
    Replies: 31
    Last Post: 12-30-2006, 02:52 AM
  3. Picture Guide to Mountains Where WSG should about be...
    By Howlingdogfish in forum World of Warcraft Exploits
    Replies: 7
    Last Post: 08-19-2006, 07:14 PM
  4. My interesting trip under stormwind.... (With pictures!)
    By idusy-org in forum World of Warcraft General
    Replies: 2
    Last Post: 08-11-2006, 03:33 AM
  5. Molten Core Guide (with pictures)
    By Matt in forum World of Warcraft Guides
    Replies: 0
    Last Post: 04-19-2006, 12:10 AM
All times are GMT -5. The time now is 02:13 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search