Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


How to erase a DrawString on a form?


Reply
 
LinkBack Thread Tools Display Modes
  #11 (permalink)  
Old 07-08-2007, 04:27 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,687
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Why don't you capture each key press, check for enter and call the lost_focus sub. That way you get an update on leaving the control or on pressing enter.

Sub tbMean_KeyPress (key)
if Asc(Key) = 13 then
tbMean_LostFocus
end if
End Sub


If you want to know what the text box is going to contain after the key press, key isn't added to the textbox until after the event is fired

Sub tbMean_KeyPress (key)
NewText = tbMean.text & key
' do something if necessary
End Sub

By the way. I don't know if you have noticed but your (I think this what it is called as I haven't got the program in front of me) Clear_Area routine is clearing parts of the curve as well.

Last edited by agraham : 07-08-2007 at 04:30 PM.
Reply With Quote
  #12 (permalink)  
Old 07-08-2007, 04:39 PM
Basic4ppc Veteran
 
Join Date: Apr 2007
Posts: 200
Default

Hi Agraham,
Thnx for your input. i will try that as well...
I know the Erase part of the graph is ersing some points but I dont know how to avoid that. I am calling the Erase function one pixel below the graph so it shouldnt erase parts of the graph. Havent found out how to erase just below the graph otherwise....
Marc
Reply With Quote
  #13 (permalink)  
Old 07-08-2007, 04:50 PM
Knows the basics
 
Join Date: May 2007
Posts: 98
Default

Hi there. You know, a while ago on this very forum, Erel added a library called barcode.dll that supports the textbox changed event that will raise each time a text box changes. I cannot remember the URL, but maybe if you write barcode in the search box of the forum you may find it and play around with it and see if that makes things a bit less daunting? Just a thought. Take care then.
Reply With Quote
  #14 (permalink)  
Old 07-08-2007, 05:45 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,687
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by Stellaferox View Post
I know the Erase part of the graph is ersing some points but I dont know how to avoid that. I am calling the Erase function one pixel below the graph so it shouldnt erase parts of the graph. Havent found out how to erase just below the graph otherwise
It is because you are doing graphics work using floating point numbers and the rounding to pixel Y values and X co-ordinates is working against you. You are also generating far more data than can be displayed, something like 800 data points rather than 215.

Ideally you need an array, 0 to 214, in your case, holding integer values. I believe that if you declare an array "as int16" you get an array of 16 bit integers (non-array variables are always 64 bit floating point) or you can obtain them by the int(somevariable) function. You can then draw your graphics with both integer X (array index) and Y (array value) and predict exactly what it will look like when you do co-ordinate arithmetic. If you need a more precise value for other puposes you can either have a "shadow" array holding those more precise values or calculate them using a corrected X index like (X-grwidth/2)/(215/8) as the input value to your formula.
Reply With Quote
  #15 (permalink)  
Old 07-08-2007, 05:49 PM
Basic4ppc Veteran
 
Join Date: Apr 2007
Posts: 200
Default

Agraham, thanx, I have already tried out the exact resolution for my pixels and used the INT function in the earlier stages of development. The reason I sticked with this original is that there used to be a function to invert all the data back to probability. Since it is not included I can go easily back to my original and your suggestion. Thanks for that!
Marc
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
different Font at .drawstring MM2forever Questions & Help Needed 3 06-30-2008 06:45 PM
Incorporar Drawstring y Line en TabControl Lefabrar31 Spanish Forum 1 09-13-2007 07:17 PM
DrawString in angles diferent than 0 Cableguy Basic4ppc Wishlist 0 05-05-2007 03:13 PM


All times are GMT. The time now is 11:55 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0