473,472 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Text in a scroll bar

Bob
Is there a way to put a labe in a scroll bar as oppose to in front of
it. (Ie the scroll goes the text as oppose to under the text)

Jan 26 '07 #1
6 1472
On Fri, 26 Jan 2007 21:13:09 +0100, <Bo*@msn.comwrote:
Is there a way to put a labe in a scroll bar as oppose to in front of
it. (Ie the scroll goes the text as oppose to under the text)
Yes, inherit the scrollbar component, override the paint method, and make
it call it's base... then just draw the text wherever you want it.

Then in your app, just use your component instead.

--
- Stefan Z Camilleri
- www.szc001.com
Jan 26 '07 #2
Bob
I understand the inherit and the override the paint method but be new
to vb.net I am not sure what you mean by call it base

On Sat, 27 Jan 2007 00:34:16 +0100, "Stefan Z Camilleri"
<sz****@szc001.comwrote:
>On Fri, 26 Jan 2007 21:13:09 +0100, <Bo*@msn.comwrote:
>Is there a way to put a labe in a scroll bar as oppose to in front of
it. (Ie the scroll goes the text as oppose to under the text)

Yes, inherit the scrollbar component, override the paint method, and make
it call it's base... then just draw the text wherever you want it.

Then in your app, just use your component instead.
Jan 27 '07 #3
Is there a way to make a checkbox (button style) that is triangular
shaped?

On Sat, 27 Jan 2007 00:34:16 +0100, "Stefan Z Camilleri"
<sz****@szc001.comwrote:
>On Fri, 26 Jan 2007 21:13:09 +0100, <Bo*@msn.comwrote:
>Is there a way to put a labe in a scroll bar as oppose to in front of
it. (Ie the scroll goes the text as oppose to under the text)

Yes, inherit the scrollbar component, override the paint method, and make
it call it's base... then just draw the text wherever you want it.

Then in your app, just use your component instead.
Jan 27 '07 #4
On Sat, 27 Jan 2007 11:24:09 +0100, <Bo*@msn.comwrote:
I understand the inherit and the override the paint method but be new
to vb.net I am not sure what you mean by call it base

On Sat, 27 Jan 2007 00:34:16 +0100, "Stefan Z Camilleri"
<sz****@szc001.comwrote:
>On Fri, 26 Jan 2007 21:13:09 +0100, <Bo*@msn.comwrote:
>>Is there a way to put a labe in a scroll bar as oppose to in front of
it. (Ie the scroll goes the text as oppose to under the text)

Yes, inherit the scrollbar component, override the paint method, and
make
it call it's base... then just draw the text wherever you want it.

Then in your app, just use your component instead.
Ok... no problem... let me explain...

So you have the default scrollbar, and you are going to create a new class
that inherits from scrollbar... say call it scrollbarfoo.

ex. Public Class ScrollBarFoo Inherits ScrollBar

Now... if you create an instance of scrollbarfoo, it is going to look like
a normal scrollbar, since you haven't changed anything from the original
scrollbar. But we want some text to appear on it, so we want to override
(replace) the method that 'draws' the scrollbar on the form.

This method is really split into two, there is the onpaintbackground
method and the onpaint event.

So.. create a method that overrides the original onpaint method that
you're inheriting. Since you don't want to go through the hassle of
re-drawing the entire scrollbar (and you don't want to believe me), the
first thing you're going to do is to call the original onpaint method (the
one you're replacing)... this will draw the usual scrollbar for you, now
all you need to do is continue to add any other graphics that you want..
in your case, you want to use the Graphics.DrawString method.

The command you want to use to call the base class is MyBase

--
- Stefan Z Camilleri
- www.szc001.com
Jan 27 '07 #5
On Sat, 27 Jan 2007 13:37:48 +0100, <Je**@aol.comwrote:
Is there a way to make a checkbox (button style) that is triangular
shaped?

On Sat, 27 Jan 2007 00:34:16 +0100, "Stefan Z Camilleri"
<sz****@szc001.comwrote:
>On Fri, 26 Jan 2007 21:13:09 +0100, <Bo*@msn.comwrote:
>>Is there a way to put a labe in a scroll bar as oppose to in front of
it. (Ie the scroll goes the text as oppose to under the text)

Yes, inherit the scrollbar component, override the paint method, and
make
it call it's base... then just draw the text wherever you want it.

Then in your app, just use your component instead.
Yes of course, inherit the normal checkbox and totally replace (override)
its paint method. That is all you need to do really since the rest of the
functionality would still be the same, you're just changing the way it
draws itself.
--
- Stefan Z Camilleri
- www.szc001.com
Jan 27 '07 #6
And is there a way to override the onPaint method of a ComboBox, I
tried this and it seems that the OnPaint method is never called for a
ComboBox, I might be wrong, but I can do the exact same thing for a
Textbox and it works.

Also, do you know what is the control that is used for the button of
the comboBox, because it seems to change with Windows Theme, but it
does not look like a regular button.

Thanks

Jan 29 '07 #7

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

Similar topics

4
by: Cat Laugel | last post by:
Hello, I am redesigning my website and would like to have the text scroll within the webpage without the page itself scrolling.... if you understand what I mean... ;-) I want a very sleek look...
1
by: michaaal | last post by:
Does anyone know of a JavaScript that will do a marquee type text scrolling like the one on this page... http://www.rentacoder.com The one on the above link uses the <marquee> HTML tags, and I...
1
by: Mickey | last post by:
Hi, I have a script which works in both IE but is sluggish in Firefox. The script is a simple text scroller. It works perfectly in IE however in Firefox, the text scroll slower and eventually...
0
by: Finn Ellermann | last post by:
hi How to add text to a textbox in Pocket PC, so the box is updated and the text Scroll up. Regards Finn
3
by: Urs Vogel | last post by:
Hi I'm looking for a way to trap the ListView's scroll events, in order to control page-wise loading of not bindable data. Any hints of how to achieve this? Thanks, Urs
0
by: Bill Nguyen | last post by:
VS 2003 ..NET framework 1.1 Client/development: XP professional SP2 When I click on the combobox to change the display value, the text scroll left off the .text area and dark blue backcolor...
3
by: ledzepfan32 | last post by:
This seems easy, but I am having trouble anyways. How can I make text appear letter by letter and scroll out using c++? I am working on a program, but just to add some flare i would like to do this...
5
Death Slaught
by: Death Slaught | last post by:
Here comes the headaches. Ok I need to know how to do the following. (I think my brains gona fall out.....please don't just give me the answer but talk me through it so I can understand it.) ...
0
dzenanz
by: dzenanz | last post by:
Platform: VS2005/WinXP/.NET 2.0 I am trying to make one sentence of text scroll from right to left over the form (that works well enough, although not perfect). Problem is, when I try to add...
0
by: svibuk | last post by:
flash vertical text scroller download scroll sites tool swf software i want to create a vertcial scrol text like the example above i have an external xml file having data can anybody help me in...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...
1
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...
1
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
0
muto222
php
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.