CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Join Date
    Jan 2011
    Location
    Morocco
    Posts
    17

    Exclamation [Help] Problem of desplaying image when using ActiveSkin for my Project in VB6!!

    Hello everyone and every developer.. This is my first time here.. I had a problem with Vb6 when I'm using Active Skin to make a theme for my project but the Images which i added on the forms doesn't appears because something is missing right!

    but when i disable the skin, the images appears again.. I really don't know where the problem is exaclty.. please if someone of u know the best solution to solve it... reply guys Plz

  2. #2
    Join Date
    Jul 2005
    Location
    Quebec, Canada
    Posts
    75

    Lightbulb Re: [Help] Problem of desplaying image when using ActiveSkin for my Project in VB6!!

    You don't need to use active skin to make your own skined window. I use images with mouse_move, down and up events. I draw Each buttons and the windows borders. See results in the attachments.

    Basically, you need subs that control how the borders are placed and drawn. You need to use the ReleaseCapture thing to make your form moveable by using the Mouse_down event of the image you use for your title bar. You can use an image control to show in the top left corner the forms icon (me.icon). Then you can use your imagination or custom made buttons for your close, minimize and restore buttons at the top that you control using the mouse event's of these images.

    Place a Timers that will check if your cursor is out of the controls to put their images back to normal, see my thread here for mouse functions: http://www.codeguru.com/forum/showthread.php?t=507086

    Use the me.windowstate to apply the close, minimize and restore effects to your form.

    Like that, it seems complicated but once you have done a skeleton application, you can always copy and paste the code to your other projects. As you see in my screenshots, I drew everything by hand or copied from lready existing themes(Windows Seven in this case).

    I know this does not help answer your question with the control you are attempting to use but this is a solution to your problem that will not make you use someone elses OCX that you will need to release with your appilication.

    That's the reason I developped my own theme code that uses the built in controls that VB has by default ie image control and labels for buttons with captions and images. That's a bit trickier but doable with 1 back image, one icon image, a caption label and a label on top of everything that controls the mouse events. That's what I do with the small buttons in the toolbar in the screenshots. I just decided to remove the captions by deleting the caption labels.

    If you do this, you will have full control over your form's appearance and you will be able to move anything in the form and use any image for your own sake.

    I hope this will help you a bit, or else, well good luck with your theme control, which, by the way is not free.
    Attached Images Attached Images   
    Last edited by avidichard; January 4th, 2011 at 12:51 PM.
    David Richard

  3. #3
    Join Date
    Jan 2011
    Location
    Morocco
    Posts
    17

    Re: [Help] Problem of desplaying image when using ActiveSkin for my Project in VB6!!

    Thank you for your useful information!! but what do u think is better? the tool or designing your own skins!!!

    for me i found the tool is easy and it has also a skin builder to make any skin that u want but the problem is that what i told ya before.. i'll show ya examples in attechement

  4. #4
    Join Date
    Jul 2005
    Location
    Quebec, Canada
    Posts
    75

    Cool Re: [Help] Problem of desplaying image when using ActiveSkin for my Project in VB6!!

    I downloaded your project and as I said, the best way is to build the theme yourself. Your ocx is missing and I can't run your application. You will notice that most sofwares similar to your run without extra ocx. They are standalone and need no file regisitration.

    That's why I suggested building your own theme with default controls. I'm beggining to start a project that I will use as a skeleton for themes. I will keep this thread up and post the themed and complete project here. I may take a while but I wrote down the basics for themes. I do realize that you want it to work with your ocx and if you really want to use it, I cannot help you.

    When you learn to build your own themes, you learn that nothing stops you anymore, no limits, your imagination is your limit!!! That's what I chose.

    Keep it up, I hope you'll find a solution to your problem with your control.
    David Richard

  5. #5
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: [Help] Problem of desplaying image when using ActiveSkin for my Project in VB6!!

    If you didn't REGISTER and pay for your software, then you CAN'T DISTRIBUTE IT ANYWAYS.
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  6. #6
    Join Date
    Jan 2011
    Location
    Morocco
    Posts
    17

    Re: [Help] Problem of desplaying image when using ActiveSkin for my Project in VB6!!

    Yeah you're right!! i got Ur point and I'm totally with ya.. but as I'm a beginner in building skins and themes, I really don't have any idea where to start even if I'm a Graphic Designer but I don't know where to start to build my themes... If ya can show me a good Tutorial how to make it yourself.. I'll design a very cool skins .. Ya know my greatest theme is that one in default ProRat Skin (Black One)
    I really love it..
    Anyway take your time if ya want to talk with me directly I'll send u my email then when can talk.. I guess I need ya as much as ya need me in other things ..

    Have a nice day brother
    Wish ya the best always

  7. #7
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: [Help] Problem of desplaying image when using ActiveSkin for my Project in VB6!!

    You should really be using VS 2008, as most controls are no longer available for VB6. I use www.devexpress.com controls, but most aren't free. They do give me the Office 2010 Ribbon, though.
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  8. #8
    Join Date
    Jul 2005
    Location
    Quebec, Canada
    Posts
    75

    Cool Re: [Help] Problem of desplaying image when using ActiveSkin for my Project in VB6!!

    dglienna: I know you like any VB better than VB6 but this post was put in a VB6 forum so the personne that posted this presume's that he/she will get a VB6 answer. Everything is possible in VB6 and the Microsoft like ribon is nothing compared to what is possible to do with the free hand interface I've created.

    Anoir: I'll give you a few hints and pieces of code here. These codes are available if you search a bit for them but I won't give you that hassle because I hate it when people do it to me.

    1. This code is to be put in the Mouse_down event of your image that you will be using for your title bar or your background. NOTE: it can be put in the Mouse_Down event of any control or event the form. Make sure to see if Button = vbLeftButton before unless you don't care which button is pressed. This code will make sure that your form is moveable without a border. Put this in a module (preferable but not necessary).

    Code:
    ' To move a frameless form
    Private Declare Function ReleaseCapture Lib "user32" () As Long
    Private Const HTCAPTION As Long = 2
    Private Const WM_NCLBUTTONDOWN = &HA1
    
    Public Declare Function SendMessage Lib "user32" _
      Alias "SendMessageA" (ByVal hwnd As Long, _
      ByVal wMsg As Long, ByVal wParam As Integer, _
      ByVal lParam As Long) As Long
    
    ' Move a frameless form
    Public Sub MoveForm(ByVal oForm As Form)
    
      ReleaseCapture
      SendMessage oForm.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0
    
    End Sub
    2. If you create backgrounds with GIF's that have transparent parts or BMP images that use a specific color that should be transparent, use this code to set a color totally transparent and click through. I use it a lot and it's very practical. Please note that I won't treat PNG images and forms because it's a bit more complicated and too much hassle to work with. Again, put this in a module but it doesn't matter where you put it, it's just preferable.

    Code:
    ' Set color transparent
    Private Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hwnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
    Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
    
    Private Const GWL_EXSTYLE = (-20)
    Private Const WS_EX_LAYERED = &H80000
    Private Const WS_EX_APPWINDOW = &H40000
    Private Const LWA_COLORKEY = &H1
    
    Public Sub SetColorTransparent(ByVal oFrm As Form, ByVal lColor As Long, ByVal bMakeTransparent As Boolean)
    
      Dim iTrans As Integer
      
      iTrans = 255
      
      If bMakeTransparent = False Then iTrans = 0
    
      SetWindowLong oFrm.hwnd, GWL_EXSTYLE, WS_EX_LAYERED Or WS_EX_APPWINDOW
      SetLayeredWindowAttributes oFrm.hwnd, lColor, iTrans, LWA_COLORKEY
    
    End Sub
    3. For the buttons this is the basics you need. My buttons are composed in 4 or 5 parts. One button is an arrayed (Indexed) image. Here are the indexes:
    0: The button itself
    1: The image of the button when up
    2: The image of the button when hovered
    3: The image of the button when down or clicked
    Optional 4: The image of the button if disabled

    Now when you Mouse_Move over Image(0), you set your Image(0)'s image to Image(2)'s image or Image(3)'s image if you clicked but did not yet Mouse_up.

    Mouse_Down of Image(0) sets it's image to Image(3).

    Mouse_Up Image(0) set's it's image back to Image(1) or Image(2) if ever the mouse is still inside the image.

    That's where my mouse module comes in handy, see previouse thread.

    Finally, you need a timer that will check if a mouse is inside Image(0) to make sure it always stay's with Image(1)'s picture if ever the mouse was not clicked. Because a control can't capture a mouse move outside itself if it has not been Mouse_Down.

    I hope these tips help you out to begin with before I have the time to put my example up.
    David Richard

  9. #9
    Join Date
    Jan 2011
    Location
    Morocco
    Posts
    17

    Smile Re: [Help] Problem of desplaying image when using ActiveSkin for my Project in VB6!!

    Thank ya so much avidichard and thanks for ya too dglienna.. I'll try to make it up soon

  10. #10
    Join Date
    Jan 2011
    Location
    Morocco
    Posts
    17

    Re: [Help] Problem of desplaying image when using ActiveSkin for my Project in VB6!!

    Ohhh !!! Avidichard !! I really got stuck making it :S I'm not professional sorry I need a Simple Video Tutorial !!!! would ya mind make it for me that will make me understand more.. i do apologize to disturbed ya with me all the time

  11. #11
    Join Date
    Jul 2005
    Location
    Quebec, Canada
    Posts
    75

    Re: [Help] Problem of desplaying image when using ActiveSkin for my Project in VB6!!

    Give me a day or 2. I'll see what I can do!
    David Richard

  12. #12
    Join Date
    Jan 2011
    Location
    Morocco
    Posts
    17

    Re: [Help] Problem of desplaying image when using ActiveSkin for my Project in VB6!!

    Take ur time bro

  13. #13
    Join Date
    Jul 2005
    Location
    Quebec, Canada
    Posts
    75

    Arrow Re: [Help] Problem of desplaying image when using ActiveSkin for my Project in VB6!!

    I'm working on the tutorial. Please be patient. It's easy stuff to say but to program it's another game.

    Using simple buttons is a simple task but when it come's time to more complexe one's that have an icon and a caption, that's something else.

    I will post the project once finished. I'm just trying to make the program with good coding. That means that you won't need to write a full bunch of lines each time you want to animate your buttons with the new style.
    David Richard

  14. #14
    Join Date
    Jul 2005
    Location
    Quebec, Canada
    Posts
    75

    Resolved Re: [Help] Problem of desplaying image when using ActiveSkin for my Project in VB6!!

    The tutorial is up, see below to download the project. I have also included a screenshot for those that want to see what the final results are.

    In this tutorial, NO OCX are used, NO DLLs. The only things that are needed is what your VB app needs to have to run and the files the API's mentioned above need.

    I hope this will help other's in creating original softwares.
    Attached Images Attached Images  
    Attached Files Attached Files
    David Richard

  15. #15
    Join Date
    Jan 2011
    Location
    Morocco
    Posts
    17

    Thumbs up Re: [Help] Problem of desplaying image when using ActiveSkin for my Project in VB6!!

    long time bro.. i was busy with studies !! so lastly u upload somethin.. i hope that will be helpful this time .. Thank ya again cute brother ^^

Page 1 of 2 12 LastLast

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