473,327 Members | 2,103 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,327 software developers and data experts.

Button Array with faster painting

Hi

I am developing a custom on screen keyboard. So far I have an array of
buttons and then using SendKeys to send the text of the button to the active
control to receive the text.

The only problem is that the application is rather slow at painting the
buttons. Ideally I wanted to allow the user to re-size the control and
change the text and style of the buttons without such rendering issues.
(I have a tool to re-size the buttons, its just the paint that is an issue
here)

Is there anyway to render a series of controls in a more efficient way than
going something like:

Friend WithEvents Button1 As Button
Me.Button1 = New Button
Me.Button1.Location = New System.Drawing.Point(32, 32)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(24, 24)
Me.Button1.TabIndex = 0
Me.Button1.Text = "Q"

and so on for all the other keys.

And then when the user clicks the CapsLock button I would then go through
all the buttons setting the text ToUpper ot ToLower.

Regards, Carl Gilbert
Nov 21 '05 #1
2 1789

"Carl Gilbert" <cn*@newsgroup.nospam> wrote

I am developing a custom on screen keyboard. So far I have an array of
buttons and then using SendKeys to send the text of the button to the active
control to receive the text.

The only problem is that the application is rather slow at painting the
buttons. Ideally I wanted to allow the user to re-size the control and
change the text and style of the buttons without such rendering issues.
(I have a tool to re-size the buttons, its just the paint that is an issue
here)

Is there anyway to render a series of controls in a more efficient way than
going something like:

Friend WithEvents Button1 As Button
Me.Button1 = New Button
Me.Button1.Location = New System.Drawing.Point(32, 32)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(24, 24)
Me.Button1.TabIndex = 0
Me.Button1.Text = "Q"

and so on for all the other keys.


That creates a new control, (IMHO) it does nothing about rendering.
Rendering is the action needed to make the control visible on the screen,
just the painting part, not the creation of a new control.

In any case, you could loose all your button controls, and manage the
keys yourself using regions, or simple X and Y calculations. You'd keep
a backbuffer of the keyboard image for use in the paint event, and draw
directly to the screen for user interaction. You can use the ControlPaint
class to help with drawing the 3D buttons.

A while ago someone else wanted Toolbar type buttons, where drawing
them in code was the only way to get them. Here is that example:

http://groups.google.com/groups?selm...TNGP09.phx.gbl

HTH
LFS
Nov 21 '05 #2
Carl,

As long as you are not using system.drawing for the painting of a button,
that should go fast.

In my opinion is there probably something else what stops your program
showing those buttons than the code you showed us.

Just my thought,

Cor
Hi

I am developing a custom on screen keyboard. So far I have an array of
buttons and then using SendKeys to send the text of the button to the
active control to receive the text.

The only problem is that the application is rather slow at painting the
buttons. Ideally I wanted to allow the user to re-size the control and
change the text and style of the buttons without such rendering issues.
(I have a tool to re-size the buttons, its just the paint that is an issue
here)

Is there anyway to render a series of controls in a more efficient way
than going something like:

Friend WithEvents Button1 As Button
Me.Button1 = New Button
Me.Button1.Location = New System.Drawing.Point(32, 32)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(24, 24)
Me.Button1.TabIndex = 0
Me.Button1.Text = "Q"

and so on for all the other keys.

And then when the user clicks the CapsLock button I would then go through
all the buttons setting the text ToUpper ot ToLower.

Regards, Carl Gilbert

Nov 21 '05 #3

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

Similar topics

8
by: Peter B. Steiger | last post by:
The latest project in my ongoing quest to evolve my brain from Pascal to C is a simple word game that involves stringing together random lists of words. In the Pascal version the whole array was...
6
by: Scatropolis | last post by:
Is GDI as fast as drawing gets? I'm writing a program that deals with drawing a ridiculous amount of lines and am finding GDI a little slow, or just maybe how I'm using it. I was looking at some...
18
by: jrhoads23 | last post by:
Hello, I am trying to find a way to tell if an .NET windows forms Button (System.Windows.Forms.Button) is "depressed" (pushed down). For my application, I can not use a check box control set to...
9
by: JW | last post by:
Dear NG, Still working on my .NET CF C# forms application ... I have an array of forms that I wish to display in array order, and thus have created a loop to run through them. Due to...
8
by: Stefan Richter | last post by:
I want to paint some bars, as soon as a button get klicked. My Paint Method has this signature: Private Sub PaintChart(ByVal sender As Object, ByVal e As PaintEventArgs, ByVal insolvent As...
21
by: yeti349 | last post by:
Hi, I'm using the following code to retrieve data from an xml file and populate a javascript array. The data is then displayed in html table form. I would like to then be able to sort by each...
8
by: per9000 | last post by:
Hi all, I have a two-dimensional array of data, f.x int's. We can imagine that the array is "really large". Now I want the data in it and store this in a one-dimensional array. The obvious...
2
by: Gugale at Lincoln | last post by:
Hi, I am creating a user control which has a radio button and few other controls. I would like the user control to behave like a radio button, in the sense when added to a container radio button...
8
by: linuxfedora | last post by:
Which one is faster or any other better way to do it. I have an array of byte with name: sendBuffer, and i will like to make some thing like that the value started from index of the array in...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.