473,598 Members | 3,324 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

user control scroll

Hi,

I am writing a hex edit control from a UserControl. I use drawtext
method of the graphics object in the OnPaint. When the text which I
draw go out of the visible rectangle of the control I want to create
scrollbars but they don't appear - I set autoscroll to true and
autoscrollmargi n to (5,5).
If I add a button or other controls the scrollbars are working.

What can I do and what is my mistake?

Thanks.

Dec 2 '05 #1
1 6269
edi,

Yes, this is the way how the build-in scrolling works in windows forms. The
control is a container and it scrolls its content (the controls it contains)
e.g. If a child control doesn't fit the scrolling area it shows up scroll
bars, so one can scroll to see all the controls.

The idea of implementing scrolling in windows forms is to add a child
control (e.g. panel ) to the scrollable control and use this panel as a
drawing canvas. When you need more space just resize the panel and the
container will adjust the scroll bars accordingly.

If you want to implement the type of scrolling you are after you need to use
scrollbar controls and implement your own logic of invalidation and redraw.

I also sometime miss the old Win32 scolling API.
HTH
Stoitcho Goutsev (100) [C# MVP]

"edi sol" <es********@gma il.com> wrote in message
news:11******** **************@ g47g2000cwa.goo glegroups.com.. .
Hi,

I am writing a hex edit control from a UserControl. I use drawtext
method of the graphics object in the OnPaint. When the text which I
draw go out of the visible rectangle of the control I want to create
scrollbars but they don't appear - I set autoscroll to true and
autoscrollmargi n to (5,5).
If I add a button or other controls the scrollbars are working.

What can I do and what is my mistake?

Thanks.

Dec 2 '05 #2

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

Similar topics

12
12719
by: Arlie Rahn | last post by:
I would like to ad a custom scroll bar control to my app that has a customizable and "flat" look to it (not the normal VB look). Does anyone have any ideas on where to find a good one?
1
7646
by: Raj | last post by:
Hi, I would like to have my user control to support scrollbars. So that when the user control is embeded in a pane/view, and the view size is reduced to less than the size of the usercontrol, the user control must show scroll bars. Currently I tried by setting the AutoScroll property to true. Also, I handled the 'Form1_SizeChanged' event for the form. Here I invoke a 'Resize' routine defined by the UserControl - 'ResizeControl' :-
6
11274
by: martin | last post by:
Hi, I am a web page and a web user control. My web user control is placed in my web page using the following directive <%@ Register TagPrefix="uc1" TagName="Header" Src="WebControls/Header.ascx" %> The web user control contains the following server controls
2
1869
by: Mark | last post by:
I have basically a 2 part question: 1) is there a way to have a listview that can scroll, but hide the scrollbars. I know that sounds odd, but this is a touch screen app and there are "scroll buttons (just command buttons with graphic)" that go to the next/previous item in the list and that allows the scrolling. I know they can drag the scroll bar down by touching, but that causes me a problem when the selected item goes out of view...
0
1309
by: WhiteWizard | last post by:
Here’s the situation: I am writing a C# Windows application using VS 2003. I have built a user control, and it has a Tab Control on it with (currently) 2 tab pages, and the whole thing sits on a panel (for resizing with a splitter etc). Each of the tab pages is marked AutoScroll = true. When I load the application I load a tree-view control (scrollable = false), to the first tab page, and that page has system scroll bars that...
2
2113
by: MrNobody | last post by:
IF I am making a custom user control which draws stuff that might exceed its boundaries, can I get the user control to handle the scrolling for me? The AutoScroll property doesn't seem to be doing it. Do I have to set some special Size so it knows it's supposed to scroll? Currently by default behavior it is just clipping my content and not putting any scrollbar. and if I can somehow get the user control to add the scrollbar how can I...
5
1731
by: MLH | last post by:
I have a vehicle entry form with a combo box for choosing the owner. Let's say the user opens the list by clicking the arrow then choose the owner by clicking a name. That much works fine. But the problem begins here... If for some reason, the user is uncertain of his first choice of an owner and decides to drop the list down again, using his keyboard up 'n down arrows to scroll the list, browsing for other owner choices until he's...
0
1249
by: alwayssmiling | last post by:
Hi, In my application, In the main form tab control is there. For this im adding a tabpage which contains a user control, this usercontrol contains many windows controls and other userdefined controls. In this Usercontrol a panel is there, which is a parent control for all reamaining controls. In this panel, a splitter control is there, in this splitter control left side i have another panel. In order to resize the controls based on the...
3
2514
by: =?Utf-8?B?Qw==?= | last post by:
Hi, I have a user control which I use on all my pages. The control is situated on the top of my page (sits on my master page). For some long pages the user has to scroll back up to the top of the page to select an option from my user control. Can I make this user control floatable so that as the user scrolls down the page the user control moves down also?
0
7991
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
8398
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...
1
8050
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8265
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6719
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...
0
5438
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();...
0
3898
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...
0
3939
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1504
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.