Results 1 to 4 of 4

Thread: icon and mouse over question

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2000
    Location
    Virginia Beach
    Posts
    66

    Smile

    I have 2 questions;
    1) i want to change the default icon on my form when i try to do this in code:
    Form1.Icon = LoadPicture("c:\scooby.ico")
    i get a run time error 53, file not found even though the path is right, if i try to change it at design time in the properties of the form i get an error, invalid property value.
    I am trying to make my own icon, so is my problem when i am saving it? I used snagit to get a picture, made sure it was 32 x 32 pixels and then saved it with an .ico extension?

    2)Can i change the caption of a command button when the mouse pointer moves over it, but then it goes back to the orginal caption when the pointer moves off it. I managed to change the pointer itself but would really like to change the caption. Any ideas?

    BTW anyone have the answer to the question I posted 2 days ago regarding sending email from my application when my default mail is lotus notes????

    Thanks!
    Happy Holidays Everyone

    Cady

  2. #2
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    ok...

    1) did you just change the extension or save as a .ico?
    (Does snagit offer a save as .ico?)
    if not...get Microangelo...its excellent

    2) yes...on the mousemove event

    Code:
    Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Command1.Caption = "over"
    End Sub
    Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Command1.Caption = "off"
    End Sub
    [Edited by geoff_xrx on 12-22-2000 at 11:47 AM]
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  3. #3
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238
    cady, as for the load your own icon to the form MouseIcon properties. You can do it by loading your icon into a Resource File and then use the following syntax to load into the Form1.

    Code:
    Form1.MousePointer = vbCustom
    Form1.MouseIcon = LoadResPicture(101, vbResIcon)
    Alternative, you can juz insert a Image Control and set the image = to your Icon and the when the time where you wish to change the Form1 mouse icon, you juz need to execute the following 2 line of syntax.

    Code:
    Form1.MousePointer = vbCustom
    Form1.MouseIcon = Image1.Picture
    Well, I more prefer the resource file, 'coz i can add as many as icon i like.

    Chris.

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Mar 2000
    Location
    Virginia Beach
    Posts
    66
    Thanks geoff_xrx,
    I just got the mousemove code to work myself, except that when i click on the command button i can't get any code in the cmdButton_click() event to work...?

    As for the icon question, what i did with snagit is sorta copy the picture then do a save as something like scooby.ico and saved it to the same file that my VB project is in, when i look up the properties it says that it is a icon however it says that it's not compressed and the size is 3.05 KB.Could the size be the problem, and if so do you know how to compress it? This icon is for the upper left hand corner of the form to replace the defualt white and turquoise one that comes with VB.

    Thanks again,
    Cady

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