473,657 Members | 2,499 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

AutoScroll in a UserControl

In a UserControl, I know that the control will automatically create scrollbars and a scrolling ability when needed. However, how exactly does it decide how big the control's paintable "region" is? (ie, to decide how big to make the scrollbars, and so on).

Is it simply based on painting everything to the e.Graphics element in the OnPaint procedure, at which point the control will decide how big it currently is, and so how much is off screen

I'm asking because I am making a control very similar to the ListView control in Details view. I'm wondering, if I have 1000 items in this control, of which only, lets say, 10 are visible at a time, would I have to draw the entire 1000 items to e.Graphics in order for the control to know how much to draw?

Or is there any possible way to perhaps tell the control, without drawing, the dimensions

Thanks

Yaron
Nov 20 '05 #1
0 929

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2189
by: BestNews | last post by:
OS: XP ..Net= framework = 1.0.3705 VS.Net IDE = 7.0.9466 1. I used an ActiveX control in C# client Application. After executing Aximp of ActiveX control. I derived a class from the AxHost.
0
910
by: TF | last post by:
Hi, I am writing a User Control (inherited by class UserControl) for a Windows .Net application. The 'AutoScroll' property is set to 'true'. Now I want to scroll the view to a point on the client area of that control, where user has clicked with mouse. I found a function 'ScrollControlIntoView' but I don't have any control to bring into view, I just want to scroll to the clicked point. I was thinking to add a hidden control, move that...
0
1120
by: Thorbjørn Jørgensen | last post by:
Hi I have a UserControl where I need to control the scrolling when the mouse get neer to the edges of the control. On the UserControl AutoScroll is activated and it works, but I can not control the scrolling programatically, any cloues? Regards Thorbjørn
0
1484
by: linkspeed2000 | last post by:
Hi, All: When using AutoScroll feature, the UserControl moves the unchanged part and only paints the changed part. This only works under following situations: 1. when OnPaint() function always paints the entire view eg: OnPaint() always draws 100 lines of text, even some lines are invisible. 2. OnPaint() method only paints the visible portion, but they are painted exactly same as if the entire view is painted.
0
906
by: active | last post by:
I have a usercontrol containing a picturebox. Autoscroll is set to true and AutoScrollMinsize is also set (to the size of the Picturebox) When I resize the form (Usercontrol is Docked=fill on the form) the scroll bars appear as one would want. However, they are inactive. If I click them nothing happens and I can't move the thumb I searched news groups and it doesn't appear that people are having problems
1
1962
by: Workgroups | last post by:
Not having much luck tracking this down... I'm working with a form, Form1, which contains a panel called pnlParent. Both Form1 and pnlParent have AutoScroll = False. pnlParent contains a panel called pnlScroller. pnlScroller.AutoScroll = True. Finally, pnlScroller contains a custom control I wrote (in which I override OnPaint & paint entirely custom, if that matters). So in summary there are 4 controls with the following...
21
9955
by: Sharon | last post by:
I have added an auto scroll feature to my DataGrid control like this: private void DoAutoScroll() { DataView dv = m_DataGrid.DataSource as DataView; DataGridCell cell = m_DataGrid.CurrentCell; cell.RowNumber = dv.Count; m_DataGrid.CurrentCell = cell; } But this the last line of this code is putting the focus on the current
3
2282
by: Tom Bianchi | last post by:
Hi, I have a Panel with the AutoScroll property set to True and many TextBoxes into it, with only some of them positioned in the visible portion of the panel. Is there a Panel event that I can handle when I tab from textbox to textbox and the panel has to scroll *automatically* from the current position to bring the focused control into view ? I know it is possible to use the Enter event of each textbox, but I must execute a time...
0
3707
by: MrNobody | last post by:
Here is a quick sample app I made which illustrates the problem I am having making my own UserControl: how do I get scrollbars to appear if I draw something bigger than the ClientSize ? Apparently Autoscroll doesn't do it, and if I change the properties Size or ClientSize to reflect the size of the image I draw it simply makes the entire control grow instead of forcing scorllbars. In Java I would have updated the control's...
1
3550
by: =?Utf-8?B?TmV3YnJv?= | last post by:
I have this program running on PDA compact framework in which it will receive paint message from server's networkstream and updates the client's screen by drawing on this custom 'Draw' userControl. Now on the PDA this 'Draw' userControl has a size of 480 x 320. This control is added to a panel with autoscroll set to true. Since the PDA screen has a size of 320 x 240, scroll will always be visible and show the left top sectionof the...
0
8397
marktang
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...
0
8310
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,...
0
8827
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8732
jinu1996
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...
0
7333
agi2029
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...
1
6167
isladogs
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...
0
4315
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2731
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1957
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.