PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
[RESOLVED] Manifest XP Style Problems-VBForums
Results 1 to 26 of 26

Thread: [RESOLVED] Manifest XP Style Problems

  1. #1

    Thread Starter
    Hyperactive Member TupacShakur's Avatar
    Join Date
    Mar 2002
    Location
    Da Land Of Da Heartless...
    Posts
    493

    Resolved [RESOLVED] Manifest XP Style Problems

    Hey y'all,

    I only started using the manifest file technique for displaying XP style controls few days ago, as i wasnt very keen for the xp style, but most people are..

    Anyways, 2 problems i faced were:

    - Lots of flickering. When i move the mouse around the controls, flickering reaches crazy levels. What is this due to?? And is there anyway it can be more professional?


    - Another problem i faced was the focus of the controls. What i mean is that the dotted rectangle that should appear on the controls when i am moving the focus around with the tab key, is simply not appearing. I tried "pure" XP apps, and there seems to be normal focus there (different than win9x, true, but it's dotted and it's there!!).. This problem is at worst for check boxes and option buttons. For regular buttons, there seems to be some kind of a color change on the borders (which is normal, but still missing the dotted focus rect.), so it's "acceptable" for buttons.. But for the other controls, it's horrible.

    Any ideas on this matter, and how to solve it??


    Thanks .
    Last edited by TupacShakur; May 30th, 2006 at 08:37 AM.
    "And Now I'm Lika Major Threat, Cause I Remind U Of The Things U Were Made To Forget!" - (2PAC)

    "Now They Label Me a Lunatic, Couldn't Care Less, Death or Success is What I Quest, Cause I'm Fearless!" - (2PAC)

    " There's a light at the end of every tunnel, just pray it's not a train!! "



    I am 100% addicted to Tupac. What about you?
    I am 24% addicted to Counterstrike. What about you?
    The #1 Tupac Fans Web Site | The Official Tupac Web Site

  2. #2
    Fanatic Member r0ach's Avatar
    Join Date
    Dec 1999
    Location
    South Africa
    Posts
    722

    Re: Manifest XP Style Problems

    That's strange because the manifest method doesn't simulate xp styles, it is real xp styles. Do you have the link to comctl32.dll?
    VB Code:
    1. '// from vbAccelerator
    2. Private Type tagInitCommonControlsEx
    3.    lngSize As Long
    4.    lngICC As Long
    5. End Type
    6. Private Declare Function InitCommonControlsEx Lib "comctl32.dll" _
    7.    (iccex As tagInitCommonControlsEx) As Boolean
    8. Private Const ICC_USEREX_CLASSES = &H200
    9.  
    10. Public Function InitCommonControlsVB() As Boolean
    11.    On Error Resume Next
    12.    Dim iccex As tagInitCommonControlsEx
    13.    ' Ensure CC available:
    14.    With iccex
    15.        .lngSize = LenB(iccex)
    16.        .lngICC = ICC_USEREX_CLASSES
    17.    End With
    18.    InitCommonControlsEx iccex
    19.    InitCommonControlsVB = (Err.Number = 0)
    20.    On Error Goto 0
    21. End Function
    22.  
    23. Public Sub Main()
    24.    InitCommonControlsVB
    25.  
    26.    '  
    27.    ' Start your application here:
    28.    '
    29.  
    30. End Sub
    Check this link: vbAccelerator

    r0ach™
    Don't forget to rate the post

  3. #3

    Thread Starter
    Hyperactive Member TupacShakur's Avatar
    Join Date
    Mar 2002
    Location
    Da Land Of Da Heartless...
    Posts
    493

    Re: Manifest XP Style Problems

    Well, i am using somewhat different code, but i guess with the same purpose (calling the API link to comctl32.dll at form initialization)..

    Anyways, i tried the code u posted, but to no avail.. Same problems.

    Plus i am sure i am "linked" to the comctl32 dll as the xp styles are displaying, but not efficiently.. And i am sure i saw similar complaints in other threads during my extensive long hours of search in this forum..


    So guys, any solution???
    "And Now I'm Lika Major Threat, Cause I Remind U Of The Things U Were Made To Forget!" - (2PAC)

    "Now They Label Me a Lunatic, Couldn't Care Less, Death or Success is What I Quest, Cause I'm Fearless!" - (2PAC)

    " There's a light at the end of every tunnel, just pray it's not a train!! "



    I am 100% addicted to Tupac. What about you?
    I am 24% addicted to Counterstrike. What about you?
    The #1 Tupac Fans Web Site | The Official Tupac Web Site

  4. #4
    Addicted Member Tommy101's Avatar
    Join Date
    Jun 2004
    Location
    Switzerland
    Posts
    144

    Re: Manifest XP Style Problems

    I had a similar problem but i fixed when i read this:
    http://www.vbaccelerator.com/home/VB...VB/article.asp

    Also, Enable XP Style a design time:
    http://www.vbaccelerator.com/home/VB...me/article.asp

    Edit: To have a XP Button for all versions use Wokawidget's XP Button (search the codebank)
    Last edited by Tommy101; May 30th, 2006 at 09:28 AM.


    Msn Messenger is the Best

  5. #5
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: Manifest XP Style Problems

    Are you using Frames? I believe they require constant redrawing to maintain the XP theme - hence they always have lots of flickering - I've never had this problem with any other control.

  6. #6
    Addicted Member
    Join Date
    Feb 2006
    Location
    The Sea of Tranquility
    Posts
    252

    Re: Manifest XP Style Problems

    If you place the frame in a picture box it will work fine.
    Rich

    A)bort, R)etry, I)nfluence with large hammer.
    Please take a moment to rate useful posts.

  7. #7
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: Manifest XP Style Problems

    Placing the actual frame control within the picturebox doesn't stop the frame flickering.

    Using a picturebox instead of a frame would result in no flickering

  8. #8
    Addicted Member
    Join Date
    Feb 2006
    Location
    The Sea of Tranquility
    Posts
    252

    Re: Manifest XP Style Problems

    Puting the frame in a picture box sorts out any style issues.

    and for the focus rects for the option buttons, you can use the drawfocus rect api

    Code:
    Dim rt As RECT
    
    rt.top = Option1.top
    rt.Bottom = Option1.top + Option1.height
    rt.left = Option1.left
    rt.right = Option1.left + Option1.width
    Debug.Print DrawFocusRect(frmMain.hWnd, rt)
    Something like that, rectangles are fussy about their coords so it might take a bit of playing.
    Rich

    A)bort, R)etry, I)nfluence with large hammer.
    Please take a moment to rate useful posts.

  9. #9
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: Manifest XP Style Problems

    placing the frame inside a picturebox does not prevent flickering

  10. #10

    Thread Starter
    Hyperactive Member TupacShakur's Avatar
    Join Date
    Mar 2002
    Location
    Da Land Of Da Heartless...
    Posts
    493

    Re: Manifest XP Style Problems

    Tommy, The 1st link u posted is the same one posted by roach in an earlier post. But anyways, for what it's worth, i followed the described way, step by step, and the same problem..

    The 2nd link, well i dont believe my problem has to do with enabling the xp styles at design time, but anyways, i tried and also nothing happened..

    Anyways, thx for ur help .




    bushmobile, yes, i am using frames, and whenever i use frames, the flickering increases drastically.



    Rich2189, sorry, but as bushmobile said, placing the frame inside a picture box does not solve this problem. I even tried it, it doesnt solve it.
    "And Now I'm Lika Major Threat, Cause I Remind U Of The Things U Were Made To Forget!" - (2PAC)

    "Now They Label Me a Lunatic, Couldn't Care Less, Death or Success is What I Quest, Cause I'm Fearless!" - (2PAC)

    " There's a light at the end of every tunnel, just pray it's not a train!! "



    I am 100% addicted to Tupac. What about you?
    I am 24% addicted to Counterstrike. What about you?
    The #1 Tupac Fans Web Site | The Official Tupac Web Site

  11. #11
    Addicted Member
    Join Date
    Feb 2006
    Location
    The Sea of Tranquility
    Posts
    252

    Re: Manifest XP Style Problems

    Quote Originally Posted by bushmobile
    placing the frame inside a picturebox does not prevent flickering
    I never implied it will prevent flickering, I mean that when option buttons are in a frame when using the maifest they might not display properly. If they do not display properly, embed the frame in a picture box with the controls in the frame.
    Rich

    A)bort, R)etry, I)nfluence with large hammer.
    Please take a moment to rate useful posts.

  12. #12

    Thread Starter
    Hyperactive Member TupacShakur's Avatar
    Join Date
    Mar 2002
    Location
    Da Land Of Da Heartless...
    Posts
    493

    Re: Manifest XP Style Problems

    Regarding the focus rectangle problem, well it's taking a rather strange form.

    1st, i was working on my Desktop PC. When i tried the whole thing on my laptop, well the focus rect. problem disappeared. Both systems have XP professional SP2.

    2nd, and after lots of testing on the Desktop PC, i noticed the following:

    - The focus rect. problem occurs whenever i load my app. manually (i click on it, in contrast of it running automatically on startup). I even tried it on both classical windows style, and xp style (the option in the Appearance tab of the Display Properties), and the problem was still there.

    - The only time the focus rectangles seem to be normal, regardless of which display style i am using within my XP Desktop PC system, is when my app loads automatically at startup.


    Anyways, this problem is strange.. But it's not that serious, as everything seems to be normal on my Laptop (and i expect on other PC's).

    As for the flickering problem, well it's still unresolved, so i'll leave this thread open.. Who knows, maybe someone will be able to find a solution !!!
    "And Now I'm Lika Major Threat, Cause I Remind U Of The Things U Were Made To Forget!" - (2PAC)

    "Now They Label Me a Lunatic, Couldn't Care Less, Death or Success is What I Quest, Cause I'm Fearless!" - (2PAC)

    " There's a light at the end of every tunnel, just pray it's not a train!! "



    I am 100% addicted to Tupac. What about you?
    I am 24% addicted to Counterstrike. What about you?
    The #1 Tupac Fans Web Site | The Official Tupac Web Site

  13. #13

    Thread Starter
    Hyperactive Member TupacShakur's Avatar
    Join Date
    Mar 2002
    Location
    Da Land Of Da Heartless...
    Posts
    493

    Re: Manifest XP Style Problems

    Anyone about the flickering ???
    "And Now I'm Lika Major Threat, Cause I Remind U Of The Things U Were Made To Forget!" - (2PAC)

    "Now They Label Me a Lunatic, Couldn't Care Less, Death or Success is What I Quest, Cause I'm Fearless!" - (2PAC)

    " There's a light at the end of every tunnel, just pray it's not a train!! "



    I am 100% addicted to Tupac. What about you?
    I am 24% addicted to Counterstrike. What about you?
    The #1 Tupac Fans Web Site | The Official Tupac Web Site

  14. #14
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: Manifest XP Style Problems

    Well, as I've said, I've never encounter flickering with anything other than frames.

    perhaps upload your project.

  15. #15

    Thread Starter
    Hyperactive Member TupacShakur's Avatar
    Join Date
    Mar 2002
    Location
    Da Land Of Da Heartless...
    Posts
    493

    Re: Manifest XP Style Problems

    Well, as i've said myself too, i am encountering problems when using frames , only i cant (or dont want to) avoid using frames.

    No solution for flickering when using frames?!!
    "And Now I'm Lika Major Threat, Cause I Remind U Of The Things U Were Made To Forget!" - (2PAC)

    "Now They Label Me a Lunatic, Couldn't Care Less, Death or Success is What I Quest, Cause I'm Fearless!" - (2PAC)

    " There's a light at the end of every tunnel, just pray it's not a train!! "



    I am 100% addicted to Tupac. What about you?
    I am 24% addicted to Counterstrike. What about you?
    The #1 Tupac Fans Web Site | The Official Tupac Web Site

  16. #16
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: Manifest XP Style Problems

    why can't you avoid using frames? there's nothing that they can do that a picturebox can't, and a picturebox doesn't flicker.

  17. #17
    Frenzied Member
    Join Date
    Jan 2000
    Location
    Brooklyn NY USA
    Posts
    1,258

    Re: Manifest XP Style Problems

    or put all controls in a picturebox in the frame.

  18. #18
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: Manifest XP Style Problems

    Quote Originally Posted by shragel
    or put all controls in a picturebox in the frame.
    any parts of the frame that are showing will still flicker, so you'd have to have the picturebox covering the entire frame, and then there's no point in using a frame.

  19. #19
    Frenzied Member
    Join Date
    Jan 2000
    Location
    Brooklyn NY USA
    Posts
    1,258

    Re: Manifest XP Style Problems

    Not true. Nothing flickers if everything is in the picturebox.

  20. #20
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: Manifest XP Style Problems

    look at the attached.

    swipe the mouse back an forth across the picturebox and frame. The black rectangles and title will flicker - demonstrating that the frame is being repainted.

    True if there were nothing on the frame, or you only moved the mouse within the picturebox, then the frame would not flicker - but then what's the point of the frame?

    Attached Files Attached Files

  21. #21

    Thread Starter
    Hyperactive Member TupacShakur's Avatar
    Join Date
    Mar 2002
    Location
    Da Land Of Da Heartless...
    Posts
    493

    Re: Manifest XP Style Problems

    Quote Originally Posted by bushmobile
    why can't you avoid using frames? there's nothing that they can do that a picturebox can't, and a picturebox doesn't flicker.
    hmmm... i donnow, i mean how can u make a picture box look like a frame?!!

    Like in the attachment i mean (the difference in borders, and in the "title" or caption of the frame)???
    Attached Images Attached Images  
    Last edited by TupacShakur; Jun 1st, 2006 at 04:45 AM.
    "And Now I'm Lika Major Threat, Cause I Remind U Of The Things U Were Made To Forget!" - (2PAC)

    "Now They Label Me a Lunatic, Couldn't Care Less, Death or Success is What I Quest, Cause I'm Fearless!" - (2PAC)

    " There's a light at the end of every tunnel, just pray it's not a train!! "



    I am 100% addicted to Tupac. What about you?
    I am 24% addicted to Counterstrike. What about you?
    The #1 Tupac Fans Web Site | The Official Tupac Web Site

  22. #22
    Addicted Member
    Join Date
    Feb 2006
    Location
    The Sea of Tranquility
    Posts
    252

    Re: Manifest XP Style Problems

    Bit of a hash but set the borderstyle to 0, draw some lines around it and smack a label on top.
    Rich

    A)bort, R)etry, I)nfluence with large hammer.
    Please take a moment to rate useful posts.

  23. #23

    Thread Starter
    Hyperactive Member TupacShakur's Avatar
    Join Date
    Mar 2002
    Location
    Da Land Of Da Heartless...
    Posts
    493

    Re: Manifest XP Style Problems

    Quote Originally Posted by Rich2189
    Bit of a hash but set the borderstyle to 0, draw some lines around it and smack a label on top.
    This way, i knew how to do it !!!

    But imagine doing this say for 6 frames within ur application (on different forms), well i might just quit programming in VB !!!


    Any other ideas??
    "And Now I'm Lika Major Threat, Cause I Remind U Of The Things U Were Made To Forget!" - (2PAC)

    "Now They Label Me a Lunatic, Couldn't Care Less, Death or Success is What I Quest, Cause I'm Fearless!" - (2PAC)

    " There's a light at the end of every tunnel, just pray it's not a train!! "



    I am 100% addicted to Tupac. What about you?
    I am 24% addicted to Counterstrike. What about you?
    The #1 Tupac Fans Web Site | The Official Tupac Web Site

  24. #24
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: Manifest XP Style Problems

    Quote Originally Posted by TupacShakur
    But imagine doing this say for 6 frames within ur application (on different forms), well i might just quit programming in VB !!!
    You let VB do it for you.

    here is a sub that will turn a picturebox in a reasonable frame look-a-like:
    VB Code:
    1. Private Sub Picture2Frame(ByRef oPic As PictureBox, ByVal sCaption As String, _
    2.                                   Optional ByVal lBorderColour As Long = &H8000000C, _
    3.                                   Optional ByVal lTextColour As Long = vbBlack, _
    4.                                   Optional ByVal oFont As StdFont)
    5.                                  
    6.     Dim lbl As Label, lGap As Long
    7.     With oPic
    8.         .AutoRedraw = True
    9.         .BorderStyle = 0
    10.         .Appearance = 0
    11.         .ScaleMode = vbPixels
    12.         .BackColor = vbButtonFace
    13.     End With
    14.     Set lbl = Me.Controls.Add("VB.Label", "piclbl" & Me.Controls.Count)
    15.     With lbl
    16.         Set .Container = oPic
    17.         .AutoSize = True
    18.         .Caption = " " & sCaption & " "
    19.         .ForeColor = lTextColour
    20.         If Not oFont Is Nothing Then Set lbl.Font = oFont
    21.         lGap = .Height \ 2
    22.         .Left = 2 * lGap
    23.         .Top = 0
    24.         .Visible = True
    25.     End With
    26.     oPic.Line (lGap, lGap)-(oPic.ScaleWidth - lGap, oPic.ScaleHeight - lGap), lBorderColour, B
    27.     Set lbl = Nothing
    28.     Set oFont = Nothing
    29. End Sub
    So in the Form_Load you do:
    VB Code:
    1. Private Sub Form_Load()
    2.     Picture2Frame Picture1, "First Frame", , vbBlue
    3.     Picture2Frame Picture2, "Second Frame", vbBlack, vbRed
    4.  
    5.     ' or you can pass a font to use as well
    6.     With Picture3
    7.         .FontBold = True
    8.         .FontName = "Comic Sans MS"
    9.         .FontSize = 14
    10.     End With
    11.     Picture2Frame Picture3, "Third Frame", , , Picture3.Font
    12. End Sub

  25. #25

    Thread Starter
    Hyperactive Member TupacShakur's Avatar
    Join Date
    Mar 2002
    Location
    Da Land Of Da Heartless...
    Posts
    493

    Re: Manifest XP Style Problems

    ^^ Seems to be some good code , i'll rep u, and see where i can go from here!!

    I'll mark this thread resolved.
    "And Now I'm Lika Major Threat, Cause I Remind U Of The Things U Were Made To Forget!" - (2PAC)

    "Now They Label Me a Lunatic, Couldn't Care Less, Death or Success is What I Quest, Cause I'm Fearless!" - (2PAC)

    " There's a light at the end of every tunnel, just pray it's not a train!! "



    I am 100% addicted to Tupac. What about you?
    I am 24% addicted to Counterstrike. What about you?
    The #1 Tupac Fans Web Site | The Official Tupac Web Site

  26. #26
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,422

    Re: Manifest XP Style Problems

    Old thread, but anyway, about this..
    Quote Originally Posted by Rich2189
    Puting the frame in a picturebox sorts out any style issues.
    Actually it is: Adding a picture box inside the frame sorts out any style issues.

    So, the controls must be added inside the picturebox, the picturebox must be added inside the frame and the picturebox border must be removed to make it invisible to the user (by default it has the same backcolor than the frame).

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width