CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Oct 2012
    Posts
    59

    [RESOLVED] How to create a Vb6 program without forms with picture?

    Hi everyone, i need your help. I want create program look without form but main program key is picture.

    First i remove Form and add module.

    Name:  2.jpg
Views: 1370
Size:  6.3 KB

    But where put my program button, picture and other things? I need this picture as my programs look.

    Name:  1.jpg
Views: 1516
Size:  19.8 KB

    Name:  1.jpg
Views: 1455
Size:  57.3 KB
    Last edited by Halosar7; October 7th, 2012 at 08:15 AM.

  2. #2
    Join Date
    Jul 2005
    Posts
    1,083

    Re: How to create a Vb6 program without forms with picture?

    To put pictures & buttons you need a form but if you don't want to see the form then you could 'remove' the form's border using the properties windows and setting BorderStyle = 0 (None)
    JG


    ... If your problem is fixed don't forget to mark your threads as resolved using the Thread Tools menu ...

  3. #3
    Join Date
    Oct 2012
    Posts
    59

    Re: How to create a Vb6 program without forms with picture?

    Quote Originally Posted by jggtz View Post
    To put pictures & buttons you need a form but if you don't want to see the form then you could 'remove' the form's border using the properties windows and setting BorderStyle = 0 (None)
    Thanks you :-) in future i use this function and remember everything you say. I do what you say but see this. Border no more, but i can see other thing, i need only picture to see, not backround around picture area.

    Name:  Untitled.jpg
Views: 1229
Size:  63.2 KB

  4. #4
    Join Date
    Jul 2005
    Posts
    1,083

    Re: How to create a Vb6 program without forms with picture?

    You could resize the form to the same size of the picture using the Paint event of the form, as:
    Code:
    Private Sub Form_Paint()
    
        Me.Width = Picture1.Width
        Me.Height = Picture1.Height
        
    End Sub
    Picture1 is the name of the control, you can change to your real control's name

    Or you could set the size at design time
    JG


    ... If your problem is fixed don't forget to mark your threads as resolved using the Thread Tools menu ...

  5. #5
    Join Date
    Oct 2012
    Posts
    59

    Re: How to create a Vb6 program without forms with picture?

    Quote Originally Posted by jggtz View Post
    You could resize the form to the same size of the picture using the Paint event of the form, as:
    Code:
    Private Sub Form_Paint()
    
        Me.Width = Picture1.Width
        Me.Height = Picture1.Height
        
    End Sub
    Picture1 is the name of the control, you can change to your real control's name

    Or you could set the size at design time

    When i try to enter width and height numbers in design time, nothing hapend. Then i try paste that code and see what have we got.
    Maybe i do a mistake somwhere.

    Name:  Untitled.jpg
Views: 1253
Size:  56.3 KB

  6. #6
    Join Date
    Jul 2005
    Posts
    1,083

    Re: How to create a Vb6 program without forms with picture?

    Post your code
    JG


    ... If your problem is fixed don't forget to mark your threads as resolved using the Thread Tools menu ...

  7. #7
    Join Date
    Jul 2005
    Posts
    1,083

    Re: How to create a Vb6 program without forms with picture?

    Sorry!
    You need to remove the .Picture propert of the form to none
    and add this code to Paint event of the form
    Code:
        Picture1.Top = 0
        Picture1.Left = 0
    Then it will be
    Code:
    Private Sub Form_Paint()
    
        Me.Width = Picture1.Width
        Me.Height = Picture1.Height
        Picture1.Top = 0
        Picture1.Left = 0
        
    End Sub
    Again, Picture1 is the name of the control, you can change to your real control's name
    JG


    ... If your problem is fixed don't forget to mark your threads as resolved using the Thread Tools menu ...

  8. #8
    Join Date
    Oct 2012
    Posts
    59

    Re: How to create a Vb6 program without forms with picture?

    Now it works :-)

    How make program look without white line around picture? When i start program i need to see blue siluet only and not white around.

    Name:  Untitled.jpg
Views: 1437
Size:  85.1 KB
    Attached Images Attached Images   
    Last edited by Halosar7; October 10th, 2012 at 05:44 PM.

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

Featured