473,387 Members | 1,621 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Drawing text without labels?

Hi,

I have an monitoring application that displays various pieces of data,
which are changing, on a tabpage within a form. The data is displayed
in various different colours and the various items are shown in
different positions on the form. It's a status panel basically.

I'm originally used labels to hold all the various bits of text.
I don't want to use labels because:
(1) I'm using the .Net Compact Framework which only allows around 100
controls before bombing out. I have multiple panels showing quite a
few labels.
(2) more importantly, it takes too long to draw on the screen. This is
a real-time monitoring application. With data conversions, it takes
around 300ms to draw about 20 floating-point data values and other
static text on the screen (I'm using WinCE on a Hitachi SH4
processor).

I was given this code snippet, which works great for the static pieces
of text (e.g. the data units, signal names etc), but if I use this
technique to display the changing data values, it means I have to
refresh the entire form (or tabpage in my case) every time. This is
too time-consuming.
Private Sub PictureBox1_Paint(ByVal sender As Object, ByVal e As
System.Windows.Forms.PaintEventArgs) Handles PictureBox1.Paint
Dim f As Font
Dim b As Brush
Dim r As RectangleF

r = New RectangleF(5, 5, 200, 20)
f = New Font("Arial", 10, FontStyle.Bold)
b = New SolidBrush(Color.White)
e.Graphics.DrawString("Cabin Temperature", f, b, r)
End Sub

It appears when I do a TabPage1.Refresh() to redraw the tab page.

I could vastly improve the speed of things if I could draw the text
without having to refresh the whole page every time - I'm updating
around (on average) 10 times a second so if I repaint the whole form
it flickers and is quite slow.

Can anyone help me repaint individual pieces of text?

Any help appreciated.

Thanks

Andy
Nov 20 '05 #1
1 1323
* an*******@hotmail.com (Andy Roxburgh) scripsit:
(1) I'm using the .Net Compact Framework which only allows around 100
controls before bombing out. I have multiple panels showing quite a
few labels.


Maybe you will get an answer here:

<news://msnews.microsoft.com/microsoft.public.dotnet.framework.compactframework >

Web interface:

<http://msdn.microsoft.com/newsgroups/default.asp?url=/newsgroups/loadframes.asp?icp=msdn&slcid=us&newsgroup=microso ft.public.dotnet.framework.compactframework>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2

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

Similar topics

27
by: Eric | last post by:
Assume that disk space is not an issue (the files will be small < 5k in general for the purpose of storing preferences) Assume that transportation to another OS may never occur. Are there...
3
by: Geoff Hague | last post by:
I've got a small little problem with my 'website-in-progress': http://www.captainsoftheworld.com/modernrepublic/strict/index.php...
4
by: Stuart Norris | last post by:
Dear Readers, I am attempting to draw box around some text using unicode on multiline label. The label is forty characters wide and 12 lines deep. I have been trying to draw a box around text...
2
by: mhansemann | last post by:
I'm a C# (but not programming in general) novice, but I couldn't find any answer to this elsewhere. I'm trying to make a text scroll on the form. I thought this was a good example to get started...
1
by: sekisho | last post by:
I'm dynamically adding a column of labels and a column of text boxes to a panel on a webform, based on data returned from an SQL query, which the user builds by selecting options from a few...
13
by: Metallicraft | last post by:
I have a vb6 application. On the main form is a picture box with one or two images and several pieces of text displayed in it. These are created on the fly using gdi32 routines that are all in a...
3
by: smHaig | last post by:
I have a page using a master page the master page consists of a header and left column table template. In the content area of the default page, I need to place alot of text. I initially had a...
9
by: liorm | last post by:
Hi folks, I need to write a short program which gets a few parameters and draws a diagram in the text file. Basically what I need is a guidance on how I put stream indicator to the required...
12
by: Petra Rohmer | last post by:
Hello, I want to ake following 0,0 (900mm,900mm) -------------------------------------- |....................................| |....................................|...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.