Hi all,
I have a few questions on deriving from ScrollableContr ol that I hope
will be relatively easy to answer. I am using Visual Studio 2003, C# and
..Net 1.1.
I have this custom control I am making called ResourceView. It is
supposed to show a visual overview of resource usage over time. Time is
represented by the X axis, and the different resources (people,
equipment, rooms etc.) are in the Y axis. Usually one will view a
limited amount of resources (a logical group/unit for instance) and time
(a 24 hour period) at once, but it will be possible to display all
resources for an entire time period - this will naturally lead to a
large amount of items.
Currently I have one control which is made up of three ScrollableContr ol
objects (extended slightly to allow me to manually control scroll
positions and also set scroll positions) - on the top is the time ruler,
on the left is the vertical resource list, and the rest (except for the
empty top left corner) is occupied by the actual view. The view is
currently a large canvas where I paint the resource "events" as square
boxes that visually give you an idea how long they last and when they
start in relation to other resource events. Each of these boxes is
actually inside another control (one per resource) that spans the length
of the view and contains all the events of a single resource - I call
these ResourceStrips for now.
When you scroll the view horizontally, the time ruler is also made to
scroll the same amount of pixels, so that the events and their place in
time lines ut properly. Likewise, when the view is scrolled vertically,
the resource list on the left is manually scrolled to keep up.
So far, all is good. I put my ResourceView into a form and dock it to
fill the entire thing. In the controls' OnResize I manually resize the
time (top) and resource (left) controls to keep up - the built in
docking functionality does not work the way I need it to. So the control
resizes beautifully and it all seems relative light on resources.
However, there are a few issues (and finally he gets to the point..?);
1) When I resize the window, the scrollbars on the top and left controls
flash on and off; This seems to happen in the ScrollableContr ol OnLayout
method, but I am not sure. Can I get rid of this? If I override OnLayout
and don't let it call base.OnLayout() , it stops flashing but it also
stops doing much of anything else, including scrolling.
2) If I click in the main view, it will reset to horizontal position
zero, and scroll vertically so the entire "resource row" (i.e.
ResourceStrip control) is in view. I am guessing this is due to some
sort of EnsureVisible() thing on the ResourceStrip? I think it is worth
nothing that the scroll reset occurs on mousedown - it doesn't wait for
me to release the mouse button. Is this a focus thing? And more
importantly, can I get rid of it?
3) Currently, each resource event (i.e. the square boxes that make up
the contents of the ResourceStrips) is simply painted on - they are not
controls. These controls could get quite heavy, in theory 500-1000
events in one view. I will need these to react to clicks and mouseovers.
Is it better to create these as individual lightweight controls? Or
should I keep painting them as graphics on the ResourceStrips.
I hope some friendly soul can shed some light on this as my head is
almost out of hair..
Thank you very much in advance for the help!
Rune 2 5577
However, there are a few issues (and finally he gets to the point..?);
1) When I resize the window, the scrollbars on the top and left controls
flash on and off; This seems to happen in the ScrollableContr ol OnLayout
method, but I am not sure. Can I get rid of this? If I override OnLayout
and don't let it call base.OnLayout() , it stops flashing but it also stops
doing much of anything else, including scrolling.
use SuspendLayout and ResumeLayout when resizing everything.
>
2) If I click in the main view, it will reset to horizontal position zero,
and scroll vertically so the entire "resource row" (i.e. ResourceStrip
control) is in view. I am guessing this is due to some sort of
EnsureVisible() thing on the ResourceStrip? I think it is worth nothing
that the scroll reset occurs on mousedown - it doesn't wait for me to
release the mouse button. Is this a focus thing? And more importantly, can
I get rid of it?
3) Currently, each resource event (i.e. the square boxes that make up the
contents of the ResourceStrips) is simply painted on - they are not
controls. These controls could get quite heavy, in theory 500-1000 events
in one view. I will need these to react to clicks and mouseovers. Is it
better to create these as individual lightweight controls? Or should I
keep painting them as graphics on the ResourceStrips.
Every control requires an OS window, which won't be as efficient for
hit-testing as a binary search of a sorted list.
Just try and avoid painting areas that are scrolled off-screen, to keep
efficiency up. A resource that is partially visible can be totally painted,
using OS clipping, but if no part of the resource is visible, skip painting
it.
Your culling of off-screen resources will probably be more efficient if you
transform the current visible region back into the units of your x and y
axes (time I guess), instead of computing the screen coordinates for each
resource.
>
I hope some friendly soul can shed some light on this as my head is almost
out of hair..
Thank you very much in advance for the help!
Rune
Ben Voigt wrote:
>1) When I resize the window, the scrollbars on the top and left controls flash on and off; This seems to happen in the ScrollableContr ol OnLayout method, but I am not sure. Can I get rid of this? If I override OnLayout and don't let it call base.OnLayout() , it stops flashing but it also stops doing much of anything else, including scrolling.
use SuspendLayout and ResumeLayout when resizing everything.
Thanks for the suggestion - I was kicking myself that I didn't think of
this myself. However, in the "main" components OnResize() override, I
tried SuspendLayout() on the control itself, and around each of the
other ScrollableContr ol derived controls when their size was changed,
and when I resize the window now, I still see the scrollbar flashing.
It is perhaps worth noting that in the ScrollableContr ol's OnLayout
override, I have to call the Win32 function ShowScrollBar and set both
SB_HORZ and SB_VERT to false - otherwise the scrollbar will stay
visible. And I have to do it AFTER I do base.OnLayout() , otherwise the
same will happen again.
So I'm a bit stumped as to what I have to do to keep the control from
wanting to show me the scrollbars - it stops doing it when I set
AutoScroll to false, but then it also doesn't allow me to scroll the
contents anymore..
>2) If I click in the main view, it will reset to horizontal position zero, and scroll vertically so the entire "resource row" (i.e. ResourceStrip control) is in view. I am guessing this is due to some sort of EnsureVisible( ) thing on the ResourceStrip? I think it is worth nothing that the scroll reset occurs on mousedown - it doesn't wait for me to release the mouse button. Is this a focus thing? And more importantly, can I get rid of it?
Someone? Help!? ;)
Every control requires an OS window, which won't be as efficient for
hit-testing as a binary search of a sorted list.
Just try and avoid painting areas that are scrolled off-screen, to keep
efficiency up. A resource that is partially visible can be totally painted,
using OS clipping, but if no part of the resource is visible, skip painting
it.
Your culling of off-screen resources will probably be more efficient if you
transform the current visible region back into the units of your x and y
axes (time I guess), instead of computing the screen coordinates for each
resource.
Great tips, thank you very much! This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Gates72 |
last post by:
Hi Gurus,
I am attempting to derive a User Control from the
ScrollableControl class. I need to have control over
which scrollbars get displayed.
According to MSDN:
"To manually override which scroll bars are visible, set
the VScroll and HScroll properties. If either property is
set to false, the corresponding scroll bar will not be
|
by: Bob |
last post by:
I implemented a ScrollableControl and only want vertical scrolling. Every time I make the form smaller then the control
the control has h scroll bars even though I set it to false. I have the control anchored to all four corners. I watched the resize event and for some reason even if i keep setting hscroll to false it gets set back to true.
Thanks!
FromMSDN.
To manually override which scroll bars are visible, set the VScroll and...
|
by: softwareengineer2006 |
last post by:
All Interview Questions And Answers
10000 Interview Questions And Answers(C,C++,JAVA,DOTNET,Oracle,SAP)
I have listed over 10000 interview questions asked
in interview/placement test papers for all companies between year
2000-2005
in my website
http://www.geocities.com/allinterviewquestion/
So please have a look and make use of it.
|
by: Yehia A.Salam |
last post by:
Hello,
I'm trying to create my own control derived from ScrollableControl
public partial class qViewer : ScrollableControl{
public qViewer() {
VScroll = true;
AutoScroll = true;
}
...
}
|
by: connectrajesh |
last post by:
INTERVIEWINFO.NET
http://www.interviewinfo.net
FREE WEB SITE AND SERVICE FOR JOB SEEKERS /FRESH GRADUATES
NO ADVERTISEMENT
| |
by: freepdfforjobs |
last post by:
Full eBook with 4000 C#, JAVA,.NET and SQL Server Interview questions
http://www.questpond.com/SampleInterviewQuestionBook.zip
Download the JAVA , .NET and SQL Server interview sheet and rate
yourself. This will help you judge yourself are you really worth of
attending interviews. If you own a company best way to judge if the
candidate is worth of it.
http://www.questpond.com/InterviewRatingSheet.zip
|
by: Drew |
last post by:
I posted this to the asp.db group, but it doesn't look like there is much
activity on there, also I noticed that there are a bunch of posts on here
pertaining to database and asp. Sorry for cross-posting.
I am trying to build a "checklist", where a user can navigate to an ASP page
on the intranet which shows a list of "questions" that the user can check
off. I am trying to figure out how to do this so that it is scalable, but I
am...
|
by: Krypto |
last post by:
Hi,
I have used Python for a couple of projects last year and I found it
extremely useful. I could write two middle size projects in 2-3 months
(part time). Right now I am a bit rusty and trying to catch up again
with Python.
I am now appearing for Job Interviews these days and I am wondering if
anybody of you appeared for a Python Interview. Can you please share
the questions you were asked. That will be great help to me.
|
by: ramu |
last post by:
C# Interview Questions and Answers8
http://allinterviewsbooks.blogspot.com/2008/07/c-interview-questions-and-answers8.html
C# Interview Questions and Answers7
http://allinterviewsbooks.blogspot.com/2008/07/c-interview-questions-and-answers7.html
C# Interview Questions and Answers 6
http://allinterviewsbooks.blogspot.com/2008/07/c-interview-questions-and-answers-6.html
C# Interview Questions and Answers 5...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |