This is actually a follow on from yesterday's post about masking mouse
clicks in a user control.
The solution I have implemented - from Herfried - places a transparent
window over the entire user control, which then uses the various mouse
events to allow the user to drag the control without any clicks going
through to the buttons and dropdowns on the control below. All well and
good.
However, I am getting an unsightly flicker when I enable and disable the
feature.
I change the drag enable feature simply by making the transparent window
either visible or not visible. In either case, when the visible state is
changed, I get a flicker of the controls underneath that I cannot get rid
of. I have tried enabling double-buffering for the form and the user control
but it makes no difference. Oddly, the problem is very bad for the TrackBar
control, but imperceptible for other controls.
Can anyone suggest any other techniques for making my form and control
flicker free?
TIA
Charles 20 5037
Charles,
* "Charles Law" <bl***@nowhere.com> scripsit: The solution I have implemented - from Herfried - places a transparent window over the entire user control, which then uses the various mouse events to allow the user to drag the control without any clicks going through to the buttons and dropdowns on the control below. All well and good.
However, I am getting an unsightly flicker when I enable and disable the feature.
I change the drag enable feature simply by making the transparent window either visible or not visible. In either case, when the visible state is changed, I get a flicker of the controls underneath that I cannot get rid of. I have tried enabling double-buffering for the form and the user control but it makes no difference. Oddly, the problem is very bad for the TrackBar control, but imperceptible for other controls.
I would not actually hide the control that is placed over the other
controls. Instead, I would handle the 'MouseUp' and 'MouseDown' events
and move the controls behind the transparent control accordingly.
--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
I just tried this out and it seems to work OK.
It's probably a different drag method to yours but it was quick and simple.
I use a MenuItem (EditMenu) to switch between Design and Run Mode.
I added the Transparent Control from the other thread which I named
TransControl.
Add this code to your form:
\\\
Const WM_NCLBUTTONDOWN As Integer = &HA1
Const HT_CAPTION As Integer = &H2
Private Sub TransControl_MouseDown(ByVal sender As Object, _
ByVal e As MouseEventArgs) Handles TransControl.MouseDown
If Me.Controls.GetChildIndex(TransControl) <> 0 Then Return
Dim Child As Control
For Each c As Control In Me.Controls
If c.Bounds.Contains(e.X, e.Y) Then
If Not c Is Me AndAlso Not c Is TransControl Then
Child = c
End If
End If
Next
If Child Is Nothing Then Return
TransControl.Capture = False
WndProc(Message.Create(Child.Handle,WM_NCLBUTTONDO WN, _
IntPtr.op_Explicit(HT_CAPTION), IntPtr.Zero))
TransControl.BringToFront()
End Sub
Private Sub EditMenu_Click(ByVal sender As Object, ByVal e As EventArgs) _
Handles EditMenu.Click
If Me.Controls.GetChildIndex(TransControl) = 0 Then
TransControl.SendToBack()
Else
TransControl.BringToFront()
End If
End Sub
///
--
Mick Doherty http://dotnetrix.co.uk/nothing.html
"Charles Law" <bl***@nowhere.com> wrote in message
news:Ol**************@TK2MSFTNGP12.phx.gbl... This is actually a follow on from yesterday's post about masking mouse clicks in a user control.
The solution I have implemented - from Herfried - places a transparent window over the entire user control, which then uses the various mouse events to allow the user to drag the control without any clicks going through to the buttons and dropdowns on the control below. All well and good.
However, I am getting an unsightly flicker when I enable and disable the feature.
I change the drag enable feature simply by making the transparent window either visible or not visible. In either case, when the visible state is changed, I get a flicker of the controls underneath that I cannot get rid of. I have tried enabling double-buffering for the form and the user
control but it makes no difference. Oddly, the problem is very bad for the
TrackBar control, but imperceptible for other controls.
Can anyone suggest any other techniques for making my form and control flicker free?
TIA
Charles
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system ( http://www.grisoft.com).
Version: 6.0.701 / Virus Database: 458 - Release Date: 07/06/2004
I also tried changing the z-order, but this did not improve things for me.
In addition, the bits of the transparent window that are not covered by
controls allows the user control to be dragged even in run mode.
What may make it worse for me is that I have an MDI app with a child window.
This child window contains my user control which is itself made up of user
controls. The base class is the one that implements the transparent window,
and also includes the track bar control. When I switch between design and
run mode it is only the track bar control that disappears and is then
redrawn. It is very noticeable. It is as if there is something specific with
the track bar control.
Charles
"Mick Doherty"
<EX***********@AND.REMOVE.SQUAREBRACKETS.[mdaudi100#ntlworld.com]> wrote in
message news:eG**************@tk2msftngp13.phx.gbl... I just tried this out and it seems to work OK. It's probably a different drag method to yours but it was quick and
simple. I use a MenuItem (EditMenu) to switch between Design and Run Mode. I added the Transparent Control from the other thread which I named TransControl. Add this code to your form:
\\\ Const WM_NCLBUTTONDOWN As Integer = &HA1 Const HT_CAPTION As Integer = &H2
Private Sub TransControl_MouseDown(ByVal sender As Object, _ ByVal e As MouseEventArgs) Handles TransControl.MouseDown
If Me.Controls.GetChildIndex(TransControl) <> 0 Then Return
Dim Child As Control
For Each c As Control In Me.Controls If c.Bounds.Contains(e.X, e.Y) Then If Not c Is Me AndAlso Not c Is TransControl Then Child = c End If End If Next
If Child Is Nothing Then Return
TransControl.Capture = False WndProc(Message.Create(Child.Handle,WM_NCLBUTTONDO WN, _ IntPtr.op_Explicit(HT_CAPTION), IntPtr.Zero)) TransControl.BringToFront()
End Sub
Private Sub EditMenu_Click(ByVal sender As Object, ByVal e As EventArgs) _ Handles EditMenu.Click
If Me.Controls.GetChildIndex(TransControl) = 0 Then TransControl.SendToBack() Else TransControl.BringToFront() End If
End Sub ///
-- Mick Doherty http://dotnetrix.co.uk/nothing.html
"Charles Law" <bl***@nowhere.com> wrote in message news:Ol**************@TK2MSFTNGP12.phx.gbl... This is actually a follow on from yesterday's post about masking mouse clicks in a user control.
The solution I have implemented - from Herfried - places a transparent window over the entire user control, which then uses the various mouse events to allow the user to drag the control without any clicks going through to the buttons and dropdowns on the control below. All well and good.
However, I am getting an unsightly flicker when I enable and disable the feature.
I change the drag enable feature simply by making the transparent window either visible or not visible. In either case, when the visible state is changed, I get a flicker of the controls underneath that I cannot get
rid of. I have tried enabling double-buffering for the form and the user control but it makes no difference. Oddly, the problem is very bad for the TrackBar control, but imperceptible for other controls.
Can anyone suggest any other techniques for making my form and control flicker free?
TIA
Charles
--- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.701 / Virus Database: 458 - Release Date: 07/06/2004
> I would not actually hide the control that is placed over the other controls. Instead, I would handle the 'MouseUp' and 'MouseDown' events and move the controls behind the transparent control accordingly.
I'm not sure I quite follow you. Are you saying that you would have the
controls behind the transparent control always? If that is the case, how
would you pass the mouse events to the controls behind when the control is
not draggable, i.e not in design mode?
Charles
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:2l************@uni-berlin.de... Charles,
* "Charles Law" <bl***@nowhere.com> scripsit: The solution I have implemented - from Herfried - places a transparent window over the entire user control, which then uses the various mouse events to allow the user to drag the control without any clicks going through to the buttons and dropdowns on the control below. All well and good.
However, I am getting an unsightly flicker when I enable and disable the feature.
I change the drag enable feature simply by making the transparent window either visible or not visible. In either case, when the visible state is changed, I get a flicker of the controls underneath that I cannot get
rid of. I have tried enabling double-buffering for the form and the user
control but it makes no difference. Oddly, the problem is very bad for the
TrackBar control, but imperceptible for other controls.
I would not actually hide the control that is placed over the other controls. Instead, I would handle the 'MouseUp' and 'MouseDown' events and move the controls behind the transparent control accordingly.
-- Herfried K. Wagner [MVP] <URL:http://dotnet.mvps.org/>
* "Charles Law" <bl***@nowhere.com> scripsit: I would not actually hide the control that is placed over the other controls. Instead, I would handle the 'MouseUp' and 'MouseDown' events and move the controls behind the transparent control accordingly.
I'm not sure I quite follow you. Are you saying that you would have the controls behind the transparent control always? If that is the case, how would you pass the mouse events to the controls behind when the control is not draggable, i.e not in design mode?
You would have to implement the dragging yourself and check what control
is under the mouse pointer based on position and Z-order. Sure, that's
very complicated and I assume that there are easier solutions...
--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Hmm. The easier solution I had in mind was making the transparent control
invisible when not in design mode. Then, it's just one line.
Assuming, for the moment, that I don't go down the route of writing all this
extra code, can you think why only the track bar control should disappear,
whilst checkboxes, labels and a progress bar are rock steady?
Charles
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:2l************@uni-berlin.de... * "Charles Law" <bl***@nowhere.com> scripsit: I would not actually hide the control that is placed over the other controls. Instead, I would handle the 'MouseUp' and 'MouseDown' events and move the controls behind the transparent control accordingly.
I'm not sure I quite follow you. Are you saying that you would have the controls behind the transparent control always? If that is the case, how would you pass the mouse events to the controls behind when the control
is not draggable, i.e not in design mode?
You would have to implement the dragging yourself and check what control is under the mouse pointer based on position and Z-order. Sure, that's very complicated and I assume that there are easier solutions...
-- Herfried K. Wagner [MVP] <URL:http://dotnet.mvps.org/>
* "Charles Law" <bl***@nowhere.com> scripsit: Hmm. The easier solution I had in mind was making the transparent control invisible when not in design mode. Then, it's just one line.
Mhm... But then, the controls can receive focus, which is not the case
for VS.NET's Windows Forms designer.
Assuming, for the moment, that I don't go down the route of writing all this extra code, can you think why only the track bar control should disappear, whilst checkboxes, labels and a progress bar are rock steady?
Sorry, I don't understand this sentence... My English is too bad.
--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
> Mhm... But then, the controls can receive focus, which is not the case for VS.NET's Windows Forms designer.
Ah, yes, but that is what I want to happen. When in 'design mode' the user
can drag one of my user controls around the form and position it at will.
When they come out of design mode, the user control should behave just like
a regular control, with buttons pressing and performing actions and
dropdowns dropping down for selection. Assuming, for the moment, that I don't go down the route of writing all
this extra code, can you think why only the track bar control should
disappear, whilst checkboxes, labels and a progress bar are rock steady?
I was just asking why the track bar might behave differently. It is the only
control that I use that has this flicker problem. Actually, it is more than
just a flicker, because the control is erased and then redrawn.
Charles
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:2l************@uni-berlin.de... * "Charles Law" <bl***@nowhere.com> scripsit: Hmm. The easier solution I had in mind was making the transparent
control invisible when not in design mode. Then, it's just one line.
Mhm... But then, the controls can receive focus, which is not the case for VS.NET's Windows Forms designer.
Assuming, for the moment, that I don't go down the route of writing all
this extra code, can you think why only the track bar control should
disappear, whilst checkboxes, labels and a progress bar are rock steady?
Sorry, I don't understand this sentence... My English is too bad.
-- Herfried K. Wagner [MVP] <URL:http://dotnet.mvps.org/>
Charles,
In your many posts on your project, did anyone ever refer you to this
article on creating a Windows Forms Designer?
I'm just wondering if the article (or sample code) has any insights that may
help you in your endeavors... http://www.windowsforms.net/default....mID=13&mid=142
Along the same lines I wonder if the Sharp Develop source would give you any
ideas. http://www.icsharpcode.net/OpenSource/SD/
As it sounds like you are creating a Designer of sorts...
Hope this helps
Jay
"Charles Law" <bl***@nowhere.com> wrote in message
news:Ol**************@TK2MSFTNGP12.phx.gbl... This is actually a follow on from yesterday's post about masking mouse clicks in a user control.
The solution I have implemented - from Herfried - places a transparent window over the entire user control, which then uses the various mouse events to allow the user to drag the control without any clicks going through to the buttons and dropdowns on the control below. All well and good.
However, I am getting an unsightly flicker when I enable and disable the feature.
I change the drag enable feature simply by making the transparent window either visible or not visible. In either case, when the visible state is changed, I get a flicker of the controls underneath that I cannot get rid of. I have tried enabling double-buffering for the form and the user
control but it makes no difference. Oddly, the problem is very bad for the
TrackBar control, but imperceptible for other controls.
Can anyone suggest any other techniques for making my form and control flicker free?
TIA
Charles
I'm confused! In addition, the bits of the transparent window that are not covered by controls allows the user control to be dragged even in run mode.
Surely your controls can only be dragged by an event raised by the
transparent window, thus, if the transparent window is not on top of the
control then the control cannot be dragged.
I do see minor flicker of the Trackbar control, but I'm not sure you are
going to get rid of this.
I do not think it unreasonable to see a minor flicker when switching between
modes.
--
Mick Doherty http://dotnetrix.co.uk/nothing.html
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system ( http://www.grisoft.com).
Version: 6.0.701 / Virus Database: 458 - Release Date: 07/06/2004
Hi Jay
I am creating a designer, in fact, although that should have been the easy
part ;-)
They are actually two separate projects: one is primarily a designer; an
html forms designer. The other is a control application, where the user
needs to arrange the components they wish to control (over a serial/usb
port) on a series of windows, before they start clicking buttons to drive
the external devices.
Anyway, I will certainly look at the link. I have looked at the SharpDevelop
stuff, but there is just so much of it that tracking down the interesting
bit is a full-time job in itself.
Cheers
Charles
"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:us**************@TK2MSFTNGP12.phx.gbl... Charles, In your many posts on your project, did anyone ever refer you to this article on creating a Windows Forms Designer?
I'm just wondering if the article (or sample code) has any insights that
may help you in your endeavors...
http://www.windowsforms.net/default....mID=13&mid=142 Along the same lines I wonder if the Sharp Develop source would give you
any ideas.
http://www.icsharpcode.net/OpenSource/SD/
As it sounds like you are creating a Designer of sorts...
Hope this helps Jay
"Charles Law" <bl***@nowhere.com> wrote in message news:Ol**************@TK2MSFTNGP12.phx.gbl... This is actually a follow on from yesterday's post about masking mouse clicks in a user control.
The solution I have implemented - from Herfried - places a transparent window over the entire user control, which then uses the various mouse events to allow the user to drag the control without any clicks going through to the buttons and dropdowns on the control below. All well and good.
However, I am getting an unsightly flicker when I enable and disable the feature.
I change the drag enable feature simply by making the transparent window either visible or not visible. In either case, when the visible state is changed, I get a flicker of the controls underneath that I cannot get
rid of. I have tried enabling double-buffering for the form and the user control but it makes no difference. Oddly, the problem is very bad for the TrackBar control, but imperceptible for other controls.
Can anyone suggest any other techniques for making my form and control flicker free?
TIA
Charles
Hi Mick
Send to back does not send the transparent control/window behind the user
control; just behind the controls _on_ the user control. Therefore, wherever
there is a gap between controls, the transparent control can still be
clicked, and hence dragged.
I have just knocked up a test app to simplify the task, and I agree that
there is only slight flicker of the track bar. But, for some reason, when I
run my main app with all its windows and other controls, the effect is ten
times worse.
If it were all controls then I would agree that it might just be something I
had to live with. But when it is only one control my suspicions are raised.
Charles
"Mick Doherty"
<EX***********@AND.REMOVE.SQUAREBRACKETS.[mdaudi100#ntlworld.com]> wrote in
message news:ep**************@tk2msftngp13.phx.gbl... I'm confused! In addition, the bits of the transparent window that are not covered by controls allows the user control to be dragged even in run mode. Surely your controls can only be dragged by an event raised by the transparent window, thus, if the transparent window is not on top of the control then the control cannot be dragged.
I do see minor flicker of the Trackbar control, but I'm not sure you are going to get rid of this. I do not think it unreasonable to see a minor flicker when switching
between modes.
-- Mick Doherty http://dotnetrix.co.uk/nothing.html --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.701 / Virus Database: 458 - Release Date: 07/06/2004
Charles, Anyway, I will certainly look at the link. I have looked at the
SharpDevelop stuff, but there is just so much of it that tracking down the interesting bit is a full-time job in itself.
However their code may have the "right answer" were as we can only offer
"best guest".
I would probably do both scrutinize their code and ask here.
Just a thought
Jay
"Charles Law" <bl***@nowhere.com> wrote in message
news:uS**************@TK2MSFTNGP10.phx.gbl... Hi Jay
I am creating a designer, in fact, although that should have been the easy part ;-)
They are actually two separate projects: one is primarily a designer; an html forms designer. The other is a control application, where the user needs to arrange the components they wish to control (over a serial/usb port) on a series of windows, before they start clicking buttons to drive the external devices.
Anyway, I will certainly look at the link. I have looked at the
SharpDevelop stuff, but there is just so much of it that tracking down the interesting bit is a full-time job in itself.
Cheers
Charles
"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message news:us**************@TK2MSFTNGP12.phx.gbl... Charles, In your many posts on your project, did anyone ever refer you to this article on creating a Windows Forms Designer?
I'm just wondering if the article (or sample code) has any insights that may help you in your endeavors...
http://www.windowsforms.net/default....mID=13&mid=142 Along the same lines I wonder if the Sharp Develop source would give you
any ideas.
http://www.icsharpcode.net/OpenSource/SD/
As it sounds like you are creating a Designer of sorts...
Hope this helps Jay
"Charles Law" <bl***@nowhere.com> wrote in message news:Ol**************@TK2MSFTNGP12.phx.gbl... This is actually a follow on from yesterday's post about masking mouse clicks in a user control.
The solution I have implemented - from Herfried - places a transparent window over the entire user control, which then uses the various mouse events to allow the user to drag the control without any clicks going through to the buttons and dropdowns on the control below. All well
and good.
However, I am getting an unsightly flicker when I enable and disable
the feature.
I change the drag enable feature simply by making the transparent
window either visible or not visible. In either case, when the visible state
is changed, I get a flicker of the controls underneath that I cannot get rid of. I have tried enabling double-buffering for the form and the user control but it makes no difference. Oddly, the problem is very bad for the TrackBar control, but imperceptible for other controls.
Can anyone suggest any other techniques for making my form and control flicker free?
TIA
Charles
Charles,
Did you see this example: http://www.windowsforms.net/default....mID=10&mid=142
Hope this helps
Jay
"Charles Law" <bl***@nowhere.com> wrote in message
news:uS**************@TK2MSFTNGP10.phx.gbl... Hi Jay
I am creating a designer, in fact, although that should have been the easy part ;-)
They are actually two separate projects: one is primarily a designer; an html forms designer. The other is a control application, where the user needs to arrange the components they wish to control (over a serial/usb port) on a series of windows, before they start clicking buttons to drive the external devices.
Anyway, I will certainly look at the link. I have looked at the
SharpDevelop stuff, but there is just so much of it that tracking down the interesting bit is a full-time job in itself.
Cheers
Charles
"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message news:us**************@TK2MSFTNGP12.phx.gbl... Charles, In your many posts on your project, did anyone ever refer you to this article on creating a Windows Forms Designer?
I'm just wondering if the article (or sample code) has any insights that may help you in your endeavors...
http://www.windowsforms.net/default....mID=13&mid=142 Along the same lines I wonder if the Sharp Develop source would give you
any ideas.
http://www.icsharpcode.net/OpenSource/SD/
As it sounds like you are creating a Designer of sorts...
Hope this helps Jay
"Charles Law" <bl***@nowhere.com> wrote in message news:Ol**************@TK2MSFTNGP12.phx.gbl... This is actually a follow on from yesterday's post about masking mouse clicks in a user control.
The solution I have implemented - from Herfried - places a transparent window over the entire user control, which then uses the various mouse events to allow the user to drag the control without any clicks going through to the buttons and dropdowns on the control below. All well
and good.
However, I am getting an unsightly flicker when I enable and disable
the feature.
I change the drag enable feature simply by making the transparent
window either visible or not visible. In either case, when the visible state
is changed, I get a flicker of the controls underneath that I cannot get rid of. I have tried enabling double-buffering for the form and the user control but it makes no difference. Oddly, the problem is very bad for the TrackBar control, but imperceptible for other controls.
Can anyone suggest any other techniques for making my form and control flicker free?
TIA
Charles
Indeed. I will take another look. Wish me luck ...
Charles
"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:O7**************@tk2msftngp13.phx.gbl... Charles, Anyway, I will certainly look at the link. I have looked at the SharpDevelop stuff, but there is just so much of it that tracking down the
interesting bit is a full-time job in itself. However their code may have the "right answer" were as we can only offer "best guest".
I would probably do both scrutinize their code and ask here.
Just a thought Jay
"Charles Law" <bl***@nowhere.com> wrote in message news:uS**************@TK2MSFTNGP10.phx.gbl... Hi Jay
I am creating a designer, in fact, although that should have been the
easy part ;-)
They are actually two separate projects: one is primarily a designer; an html forms designer. The other is a control application, where the user needs to arrange the components they wish to control (over a serial/usb port) on a series of windows, before they start clicking buttons to
drive the external devices.
Anyway, I will certainly look at the link. I have looked at the SharpDevelop stuff, but there is just so much of it that tracking down the
interesting bit is a full-time job in itself.
Cheers
Charles
"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in
message news:us**************@TK2MSFTNGP12.phx.gbl... Charles, In your many posts on your project, did anyone ever refer you to this article on creating a Windows Forms Designer?
I'm just wondering if the article (or sample code) has any insights
that may help you in your endeavors...
http://www.windowsforms.net/default....mID=13&mid=142 Along the same lines I wonder if the Sharp Develop source would give
you any ideas.
http://www.icsharpcode.net/OpenSource/SD/
As it sounds like you are creating a Designer of sorts...
Hope this helps Jay
"Charles Law" <bl***@nowhere.com> wrote in message news:Ol**************@TK2MSFTNGP12.phx.gbl... > This is actually a follow on from yesterday's post about masking
mouse > clicks in a user control. > > The solution I have implemented - from Herfried - places a
transparent > window over the entire user control, which then uses the various
mouse > events to allow the user to drag the control without any clicks
going > through to the buttons and dropdowns on the control below. All well
and > good. > > However, I am getting an unsightly flicker when I enable and disable the > feature. > > I change the drag enable feature simply by making the transparent window > either visible or not visible. In either case, when the visible
state is > changed, I get a flicker of the controls underneath that I cannot
get rid > of. I have tried enabling double-buffering for the form and the user control > but it makes no difference. Oddly, the problem is very bad for the TrackBar > control, but imperceptible for other controls. > > Can anyone suggest any other techniques for making my form and
control > flicker free? > > TIA > > Charles > >
Are you dragging the transparent window or the usercontrol?
I know that you are doing this in a usercontrol instead of a form, but the
principal is the same.
I assumed you were dragging controls, as my example does. The Transparent
control is Docked to fill and the dragging of controls is activated in the
mousedown event of the transparent control. If the Transparent control is
not at zOrder 0 (i.e. OnTop of all other controls) then the Drag method is
not Initialised.
Is this not what you are doing?
--
Mick Doherty http://dotnetrix.co.uk/nothing.html
"Charles Law" <bl***@nowhere.com> wrote in message
news:us**************@TK2MSFTNGP10.phx.gbl... Hi Mick
Send to back does not send the transparent control/window behind the user control; just behind the controls _on_ the user control. Therefore,
wherever there is a gap between controls, the transparent control can still be clicked, and hence dragged.
I have just knocked up a test app to simplify the task, and I agree that there is only slight flicker of the track bar. But, for some reason, when
I run my main app with all its windows and other controls, the effect is ten times worse.
If it were all controls then I would agree that it might just be something
I had to live with. But when it is only one control my suspicions are
raised. Charles
"Mick Doherty" <EX***********@AND.REMOVE.SQUAREBRACKETS.[mdaudi100#ntlworld.com]> wrote
in message news:ep**************@tk2msftngp13.phx.gbl... I'm confused! In addition, the bits of the transparent window that are not covered
by controls allows the user control to be dragged even in run mode. Surely your controls can only be dragged by an event raised by the transparent window, thus, if the transparent window is not on top of the control then the control cannot be dragged.
I do see minor flicker of the Trackbar control, but I'm not sure you are going to get rid of this. I do not think it unreasonable to see a minor flicker when switching between modes.
-- Mick Doherty http://dotnetrix.co.uk/nothing.html --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.701 / Virus Database: 458 - Release Date: 07/06/2004
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system ( http://www.grisoft.com).
Version: 6.0.701 / Virus Database: 458 - Release Date: 07/06/2004
I am certainly dragging the transparent window. As you suggest, I am using
the mouse events of the transparent control to trigger this.
When my base class loads, I create the transparent window object, which is
declared WithEvents so that I can process the appropriate mouse events
easily.
I dock it, add it to the Controls collection, and then bring it to the front
of the z-order. Thereafter, to disable dragging I make the transparent
window invisible, thus allowing the user control below to behave like an
active control.
Up to this point, I am happy with the way it performs. It does exactly what
I want it to do. The issue I have is with the disappearing track bar. I have
tried sending the transparent window to the back and front, and every time
the track bar disappears and is redrawn. Therefore, I conclude that it is
not the hiding of the transparent window that is the problem, but something
else, intrinsic to the track bar.
Charles
"Mick Doherty"
<EX***********@AND.REMOVE.SQUAREBRACKETS.[mdaudi100#ntlworld.com]> wrote in
message news:OF**************@TK2MSFTNGP12.phx.gbl... Are you dragging the transparent window or the usercontrol? I know that you are doing this in a usercontrol instead of a form, but the principal is the same.
I assumed you were dragging controls, as my example does. The Transparent control is Docked to fill and the dragging of controls is activated in the mousedown event of the transparent control. If the Transparent control is not at zOrder 0 (i.e. OnTop of all other controls) then the Drag method is not Initialised. Is this not what you are doing?
-- Mick Doherty http://dotnetrix.co.uk/nothing.html
"Charles Law" <bl***@nowhere.com> wrote in message news:us**************@TK2MSFTNGP10.phx.gbl... Hi Mick
Send to back does not send the transparent control/window behind the
user control; just behind the controls _on_ the user control. Therefore, wherever there is a gap between controls, the transparent control can still be clicked, and hence dragged.
I have just knocked up a test app to simplify the task, and I agree that there is only slight flicker of the track bar. But, for some reason,
when I run my main app with all its windows and other controls, the effect is
ten times worse.
If it were all controls then I would agree that it might just be
something I had to live with. But when it is only one control my suspicions are raised. Charles
"Mick Doherty" <EX***********@AND.REMOVE.SQUAREBRACKETS.[mdaudi100#ntlworld.com]> wrote
in message news:ep**************@tk2msftngp13.phx.gbl... I'm confused! > In addition, the bits of the transparent window that are not covered by > controls allows the user control to be dragged even in run mode. > Surely your controls can only be dragged by an event raised by the transparent window, thus, if the transparent window is not on top of
the control then the control cannot be dragged.
I do see minor flicker of the Trackbar control, but I'm not sure you
are going to get rid of this. I do not think it unreasonable to see a minor flicker when switching
between modes.
-- Mick Doherty http://dotnetrix.co.uk/nothing.html --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.701 / Virus Database: 458 - Release Date: 07/06/2004
--- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.701 / Virus Database: 458 - Release Date: 07/06/2004
Yes I did. It doesn't go very far though, and a lot of the things it leaves
out are the tricky bits. Anyway, this project is actually complete now, and
I am at the stage of adding new features.
The live project, as it were, is the control application. That other link
you gave points to a very good article and code in both C# and VB.NET. It
shows how to do just about everything I need, and in surprising little code
as well. It doesn't specifically address the disappearing track bar problem
though.
Charles
"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:un**************@TK2MSFTNGP11.phx.gbl... Charles, Did you see this example:
http://www.windowsforms.net/default....mID=10&mid=142 Hope this helps Jay
"Charles Law" <bl***@nowhere.com> wrote in message news:uS**************@TK2MSFTNGP10.phx.gbl... Hi Jay
I am creating a designer, in fact, although that should have been the
easy part ;-)
They are actually two separate projects: one is primarily a designer; an html forms designer. The other is a control application, where the user needs to arrange the components they wish to control (over a serial/usb port) on a series of windows, before they start clicking buttons to
drive the external devices.
Anyway, I will certainly look at the link. I have looked at the SharpDevelop stuff, but there is just so much of it that tracking down the
interesting bit is a full-time job in itself.
Cheers
Charles
"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in
message news:us**************@TK2MSFTNGP12.phx.gbl... Charles, In your many posts on your project, did anyone ever refer you to this article on creating a Windows Forms Designer?
I'm just wondering if the article (or sample code) has any insights
that may help you in your endeavors...
http://www.windowsforms.net/default....mID=13&mid=142 Along the same lines I wonder if the Sharp Develop source would give
you any ideas.
http://www.icsharpcode.net/OpenSource/SD/
As it sounds like you are creating a Designer of sorts...
Hope this helps Jay
"Charles Law" <bl***@nowhere.com> wrote in message news:Ol**************@TK2MSFTNGP12.phx.gbl... > This is actually a follow on from yesterday's post about masking
mouse > clicks in a user control. > > The solution I have implemented - from Herfried - places a
transparent > window over the entire user control, which then uses the various
mouse > events to allow the user to drag the control without any clicks
going > through to the buttons and dropdowns on the control below. All well
and > good. > > However, I am getting an unsightly flicker when I enable and disable the > feature. > > I change the drag enable feature simply by making the transparent window > either visible or not visible. In either case, when the visible
state is > changed, I get a flicker of the controls underneath that I cannot
get rid > of. I have tried enabling double-buffering for the form and the user control > but it makes no difference. Oddly, the problem is very bad for the TrackBar > control, but imperceptible for other controls. > > Can anyone suggest any other techniques for making my form and
control > flicker free? > > TIA > > Charles > >
Using Enabled instead of Visible works every bit as well, without the
disappearing track bar.
Charles
"Charles Law" <bl***@nowhere.com> wrote in message
news:Ol**************@TK2MSFTNGP12.phx.gbl... This is actually a follow on from yesterday's post about masking mouse clicks in a user control.
The solution I have implemented - from Herfried - places a transparent window over the entire user control, which then uses the various mouse events to allow the user to drag the control without any clicks going through to the buttons and dropdowns on the control below. All well and good.
However, I am getting an unsightly flicker when I enable and disable the feature.
I change the drag enable feature simply by making the transparent window either visible or not visible. In either case, when the visible state is changed, I get a flicker of the controls underneath that I cannot get rid of. I have tried enabling double-buffering for the form and the user
control but it makes no difference. Oddly, the problem is very bad for the
TrackBar control, but imperceptible for other controls.
Can anyone suggest any other techniques for making my form and control flicker free?
TIA
Charles
Good Catch.
--
Mick Doherty http://dotnetrix.co.uk/nothing.html
"Charles Law" <bl***@nowhere.com> wrote in message
news:uL**************@tk2msftngp13.phx.gbl... Using Enabled instead of Visible works every bit as well, without the disappearing track bar.
Charles
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system ( http://www.grisoft.com).
Version: 6.0.701 / Virus Database: 458 - Release Date: 07/06/2004 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Abhishek |
last post by:
My objective is quite simple. I want to display a JPG image and then on it
overlay a polygon. This polygon can be moved by a user. The even is trapped
on the mouse down event of the control. I can...
|
by: Alessandro Fragnani |
last post by:
Hi,
I would like to know how to avoid flicker while adding controls to a
panel. I couldn´t find any kind of "BeginUpdate/EndUpdate" on it.
Thanks in advance
Alessandro
|
by: Per Dunberg |
last post by:
Hi all,
I have to develop a "skinned" application and I have a problem with the
graphics.
When a form is loaded and displayed there's aways a flicker where all the
controls are located on the...
|
by: Charles Law |
last post by:
Some of the eagle-eyed amongst you will spot this as a direct follow on from
my earlier post about critical timing in .NET.
I want to use a ListView to display my output (instead of the sluggish...
|
by: Jeff Williams |
last post by:
I have a form with several tabs and I want to dynamically change the
opacity of it while shown. Is there a way to stop the form updating on
screen until all controls have change opacity then allow...
|
by: Frank Rizzo |
last post by:
Hello, I inherited a large Winforms project that is suffering from
excessive flicker when switching between portions of the application.
I've noticed that most parts of the application (user...
|
by: lllomh |
last post by:
Define the method first
this.state = {
buttonBackgroundColor: 'green',
isBlinking: false, // A new status is added to identify whether the button is blinking or not
}
autoStart=()=>{
|
by: Mushico |
last post by:
How to calculate date of retirement from date of birth
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM)
The start time is equivalent to 19:00 (7PM) in Central...
|
by: tracyyun |
last post by:
Hello everyone,
I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
|
by: giovanniandrean |
last post by:
The energy model is structured as follows and uses excel sheets to give input data:
1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
|
by: Teri B |
last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course.
0ne-to-many. One course many roles.
Then I created a report based on the Course form and...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM)
Please note that the UK and Europe revert to winter time on...
|
by: NeoPa |
last post by:
Introduction
For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
|
by: isladogs |
last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, Mike...
| |