|
-
May 12th, 2009, 11:22 PM
#1
Thread Starter
Fanatic Member
Flikering
Am using api to make the vbframe control transparent.
But it flickers when i hover the mouse it.
How ca i stop this.
Any ideas?
-
May 13th, 2009, 06:13 AM
#2
Re: Flikering
You might be able to use the LockWindowUpdate API call along with some well-timed manual redraws to work around it.
The time you enjoy wasting is not wasted time.
Bertrand Russell
<- Remember to rate posts you find helpful.
-
May 13th, 2009, 09:49 PM
#3
Re: Flikering
Could you post your code? I have code that uses API to redraw anything that's under the frame into the frame DC, as background, this simulates transparency. But i would like to see your code, there is a way to draw to a backbuffer when subclassing, doing this you can avoid flickering.
-
May 14th, 2009, 04:22 PM
#4
Thread Starter
Fanatic Member
Re: Flikering
vb Code:
Option Explicit
Public Declare Function GetDC Lib "user32" (ByVal hwnd As Long) _
As Long
Public Declare Function DeleteObject Lib "gdi32" (ByVal hObject _
As Long) As Long
Public Declare Function CreateRectRgn Lib "gdi32" (ByVal X1 _
As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 _
As Long) As Long
Public Declare Function CombineRgn Lib "gdi32" (ByVal hDestRgn _
As Long, ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long, _
ByVal nCombineMode As Long) As Long
Public Declare Function GetPixel Lib "gdi32" (ByVal hDC As Long, _
ByVal x As Long, ByVal y As Long) As Long
Public Declare Function SetWindowRgn Lib "user32" (ByVal hwnd _
As Long, ByVal hRgn As Long, ByVal bRedraw As Long) As Long
Public CtrlDc As Long
Public Function GetTransparentFrame(Ctrl As Frame) As Long
Dim lHeight As Long
Dim lWidth As Long
Dim lTemp As Long
Dim lSkin As Long
Dim lStart As Long
Dim lLine As Long
Dim lColumn As Long
Dim lBackColor As Long
lSkin = CreateRectRgn(0, 0, 0, 0)
With Ctrl
'Form.ScaleMode = vbTwips
lHeight = .Height / Screen.TwipsPerPixelY
lWidth = .Width / Screen.TwipsPerPixelX
'Form.ScaleMode = vbPixels
'lHeight = .Height
'lWidth = .Width
CtrlDc = GetDC(.hwnd)
lBackColor = Ctrl.BackColor
For lLine = 0 To lHeight - 1
lColumn = 0
Do While lColumn < lWidth
Do While lColumn < lWidth And GetPixel(CtrlDc, lColumn, lLine) = lBackColor
lColumn = lColumn + 1
Loop
If lColumn < lWidth Then
lStart = lColumn
Do While lColumn < lWidth And GetPixel(CtrlDc, lColumn, lLine) <> lBackColor
lColumn = lColumn + 1
Loop
If lColumn > lWidth Then lColumn = lWidth
lTemp = CreateRectRgn(lStart, lLine, lColumn, lLine + 1)
Call CombineRgn(lSkin, lSkin, lTemp, 2)
Call DeleteObject(lTemp)
End If
Loop
Next lLine
End With
GetTransparentFrame = lSkin
End Function
Public Sub MakeFrameTransparent(Ctrl As Frame)
Dim lSkin As Long
Ctrl.Visible = True
'Set the background colour.
lSkin = GetTransparentFrame(Ctrl)
Call SetWindowRgn(Ctrl.hwnd, lSkin, True)
End Sub
Public Sub Main()
XPStyle
Form1.Frame1.BackColor = &HFF&
Form1.Show
Form1.Refresh
MakeFrameTransparent Form1.Frame1
End Sub
-
May 14th, 2009, 04:23 PM
#5
Thread Starter
Fanatic Member
Re: Flikering
I have just posted the code that makes a frame transparent. This solution is not mine
-
May 14th, 2009, 06:50 PM
#6
Re: Flikering
Does it flicker if you disable the XPstyle?
I ran into the same problem with the VB Frame control in a project that was using XPstyle, so I just ended up creating my own owner drawn frames, I posted one of them here.
-
May 14th, 2009, 07:00 PM
#7
Re: Flikering
I used that code but the Frame doesn't flicker when i hover the mouse, it does take a while until its transparent but no flickering after that.
EDIT: Yes, it must be the combination with XPStyle thats causing the flickering.
-
May 14th, 2009, 07:11 PM
#8
Re: Flikering
Ya its' slow, tried it with 4 frames and it takes what seems like forever, and the form has to be in view in the desktop area.
-
May 15th, 2009, 02:36 PM
#9
Thread Starter
Fanatic Member
Re: Flikering
is there any way to make the code faster
Last edited by coolcurrent4u; May 17th, 2009 at 03:51 AM.
Reason: typo
-
May 15th, 2009, 06:10 PM
#10
-
May 15th, 2009, 08:24 PM
#11
Hyperactive Member
Re: Flikering
I'm sure OP means "code". Sadly I can't contribute, just noting the clarification.
-
May 15th, 2009, 09:46 PM
#12
Re: Flikering
code, oh ok! should of got that!
Heres one I found on PSC that is much faster.
I tried that one before but it had a side effect, I think the caption turned magenta color on me or something under a certain condition, plus like the code posted above the form has to be shown (in the desktop area) before the transparency effect can be added and take effect.
-
May 17th, 2009, 03:55 AM
#13
Thread Starter
Fanatic Member
Re: Flikering
I have tried that solution before.i think the algorithm that makes it work is what needs to be reimplemented
Last edited by coolcurrent4u; May 17th, 2009 at 04:34 AM.
Reason: typo
-
May 17th, 2009, 04:33 AM
#14
Thread Starter
Fanatic Member
Re: Flikering
it dosent work with the frame placed on a tabstrip control that has xp style. any help
-
May 17th, 2009, 10:19 AM
#15
Re: Flikering
For issues like that, put the control (in this case the frame) inside a Picturebox, and put that in the container (the tabstrip).
-
May 18th, 2009, 05:39 AM
#16
Thread Starter
Fanatic Member
Re: Flikering
how can i make the frame transparent then. I was only succesfu to make the frame control transparent. if i put the picturebox on tabstrip it does no become transparent
-
May 18th, 2009, 11:22 AM
#17
Re: Flikering
Well in that case you are probably stuck I'm afraid, I doubt there is anything you can do about it.
-
May 18th, 2009, 01:53 PM
#18
Thread Starter
Fanatic Member
Re: Flikering
does that means that there is no solution. icant take that for an answer. maybe i'll do research onmy own.
but any help will be appreciated
-
May 31st, 2009, 05:23 PM
#19
Thread Starter
Fanatic Member
-
Jun 1st, 2009, 02:03 AM
#20
PowerPoster
Re: Flikering
On the Microsoft Office Packages, it includes a Form 2.0 Frame control, which you can package with your compiled project when you compile it. This frame control is able to use AutoRedraw and also I guess that you can make it transparent, by using Alpha channels, in the Frame control itself.
Also note: That this Frame control is named, frm20.dll, try searching for it on your Office enabled computer system. This version of the control appears in anything Office 95 or better.
I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...
|Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |
Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...
-
Jun 1st, 2009, 02:40 AM
#21
Re: Flikering
 Originally Posted by ThEiMp
On the Microsoft Office Packages, it includes a Form 2.0 Frame control, which you can package with your compiled project when you compile it.
Actually you are not allowed to redistribute Microsoft Forms 2.0 Frame, so you can not package it with your compiled project! Your users must have the Fm20.dll on their system. Read Here!
Last edited by Edgemeal; Jun 1st, 2009 at 02:44 AM.
-
Jun 1st, 2009, 12:27 PM
#22
Thread Starter
Fanatic Member
Re: Flikering
but why would microsoft want to put their developers or customers into so much trouble making the frame control transparent
what if i write microsoft?
this fearture is found in windos system property dialoge
how do i subclass this window and catch all the messages sent from and to it using spy++
maybe i might find a solution there
-
Jun 1st, 2009, 12:37 PM
#23
Thread Starter
Fanatic Member
Re: Flikering
 Originally Posted by ThEiMp
On the Microsoft Office Packages, it includes a Form 2.0 Frame control, which you can package with your compiled project when you compile it. This frame control is able to use AutoRedraw and also I guess that you can make it transparent, by using Alpha channels, in the Frame control itself.
Also note: That this Frame control is named, frm20.dll, try searching for it on your Office enabled computer system. This version of the control appears in anything Office 95 or better.
can you pls help me with some code for this
-
Jun 1st, 2009, 12:53 PM
#24
Re: Flikering
 Originally Posted by coolcurrent4u
can you pls help me with some code for this
Read Post #21 just up the page...you can use the Form 2.0 frame, but you can't redistribute it, so what would be the point?
 Originally Posted by coolcurrent4u
what if i write microsoft?
Be my guest...all that will do, however, is to provide you with written response about why you can't redistribute them. It won't give you permission to do so.
If all you are looking for is a transparent container, what about using picturebox control?
-
Jun 2nd, 2009, 03:42 AM
#25
PowerPoster
Re: Flikering
 Originally Posted by coolcurrent4u
can you pls help me with some code for this
Its not source code, that you need. Its key strokes and mouse clicking that will deliver what you want to know.
I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...
|Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |
Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...
-
Jun 2nd, 2009, 04:13 AM
#26
Thread Starter
Fanatic Member
Re: Flikering
Re: Flikering
Quote:Originally Posted by coolcurrent4u
can you pls help me with some code for this
Its not source code, that you need. Its key strokes and mouse clicking that will deliver what you want to know.
__________________
How to change a light bulb?
Ahh yes, I know that?
Light_Bulb1 = Light_Bulb1 + Ladder
am confused, please put me through
-
Jun 2nd, 2009, 06:57 PM
#27
PowerPoster
Re: Flikering
Do a search from with in the VB6's Control Dialog Box. Then select it, and click on the tick on the Control Dialog Box. Finally you can then drag the control to the Form, just like any other control that you have loaded into the Project.
I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...
|Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |
Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...
-
Jun 2nd, 2009, 07:22 PM
#28
Re: Flikering
I don't see how that helps, I just tried the Form 2.0 Frame for the first time, here's what I get,
1) It is not a container, it can't hold controls.
2) It doesn't support XP styles.
3) I don't see any Transparent property for it.
4) MS recommends you do not use this control for VC/VB.
Besides not doing what the OP wants his/her users would need to have Office installed or an alternative (see link in post 21).
-
Jun 3rd, 2009, 02:02 AM
#29
PowerPoster
Re: Flikering
You have to program in the container into it, as code.
I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...
|Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |
Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...
-
Jun 3rd, 2009, 09:49 AM
#30
Re: Flikering
 Originally Posted by ThEiMp
You have to program in the container into it, as code.
Please share your great knowledge with the rest of us and attach a working project!
Waiting.....
-
Jun 3rd, 2009, 06:23 PM
#31
PowerPoster
Re: Flikering
I can't remember the code for the Frame container, because I had worked on one many years ago. When I was a young lad programmer at HP. It was one of my working projects, but not work as such. Also its quite fiddley, and quite a head banger as well.
Well that is what I remember, anyway.
I think that you should use a HTML scrolling document, instead anyway that is somewhat better, and still the same in fact.
I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...
|Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |
Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...
-
Jun 3rd, 2009, 06:43 PM
#32
Thread Starter
Fanatic Member
Re: Flikering
pls post some code to help others
-
Jun 4th, 2009, 01:17 AM
#33
PowerPoster
Re: Flikering
I don't know about the code for the HTML controls. But I know that Microsoft uses this to scroll ActiveX controls on their Windows Update website. It has been about ten years, since I had left HP from programming, so I cannot remember any code.
So then here is the ocx file to do that. But the methods, I don't remember.
Enjoy!!
Last edited by ThEiMp; Jun 27th, 2009 at 09:41 PM.
I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...
|Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |
Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...
-
Jun 12th, 2009, 02:17 AM
#34
Thread Starter
Fanatic Member
Re: Flikering
this does not help? i don;t understand
-
Jun 12th, 2009, 07:20 PM
#35
PowerPoster
Re: Flikering
Then try reading a manual, whitepaper or something like that on the subject. I suggest try using the Internet as well.
I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...
|Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |
Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...
-
Jun 13th, 2009, 11:05 AM
#36
Thread Starter
Fanatic Member
Re: Flikering
ok if this is all i ca get thanks anyways i have stopped looking for a way to even make the frame control transparent.
-
Jun 13th, 2009, 07:11 PM
#37
PowerPoster
Re: Flikering
Or actually you could use the shape tools or even the image control to draw up one that you can use as transparent. Also the Microsoft Forms 2.0 one does allow this, but you aren't allowed to disturibute it anyway.
I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...
|Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |
Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...
-
Jun 16th, 2009, 05:06 PM
#38
Thread Starter
Fanatic Member
Re: Flikering
i just wanted to make a dialoge box that look like the xp themed version. i have searched every where. the thing is not just doing it , but making sure it works with orther os or the end user. so i decided to go for a more simple interface. thanks anyways
-
Jun 16th, 2009, 06:13 PM
#39
PowerPoster
Re: Flikering
Then use an XP theme with the project. You can use Windows to do this, but I am not quite sure how to do it, and only for one project.
I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...
|Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |
Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|