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
  #1 (permalink)  
Old 07-08-2007, 11:27 AM
Basic4ppc Veteran
 
Join Date: Apr 2007
Posts: 200
Default How to erase a DrawString on a form?

Hi,
I am trying to erase a DrawString on a form but FErase won't do it. Is there another way except rewriting the string in the backgroundcolour?
Reply With Quote
  #2 (permalink)  
Old 07-08-2007, 11:31 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 2,964
Default

If you draw the string on the fore layer you will be able to erase it with FErase.
Other options are to draw a rectangle in the background color, or to draw the text again using the background color.
Reply With Quote
  #3 (permalink)  
Old 07-08-2007, 11:45 AM
Basic4ppc Veteran
 
Join Date: Apr 2007
Posts: 200
Default

Erel, you must be desperate for all the stupid questions you get.... I forgot the F in front of the Drawstringcommand. Now it works fine...
tnx
Reply With Quote
  #4 (permalink)  
Old 07-08-2007, 11:50 AM
Basic4ppc Veteran
 
Join Date: Apr 2007
Posts: 200
Default

Meanwhile, let me propose a problem. In the attached program I want to change the Mean and SD from 100 and 16 to 0 and 1 respectively. I want to show the change on the x-axis as soon as the new value is filled in in the textbox (let's say the 0 in the Mean textbox without ENTER). Now I have to switch textboxes and back to show the change.
Any ideas?
Reply With Quote
  #5 (permalink)  
Old 07-08-2007, 11:51 AM
Basic4ppc Veteran
 
Join Date: Apr 2007
Posts: 200
Default

hmmmmm.... to quick again... here is the file... the subs are tbMean_GotFocus and tbSD_GotFocus.
thnx in advance....
Marc
Attached Files
File Type: sbp $Normal.sbp (15.9 KB, 9 views)
Reply With Quote
  #6 (permalink)  
Old 07-08-2007, 12:23 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 1,198
Default

Entering the values does not raise any event..that is the problem...The only way I would see this working would be enableing a timer when a textbox got focus and the on timer.tick do a lost focus to the textbox, raising this way the lostfocus event...
__________________
Paulo Gomes
Porto, Portugal

PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD
PPC: Qtek9000, 1GB SD
Reply With Quote
  #7 (permalink)  
Old 07-08-2007, 12:53 PM
Basic4ppc Veteran
 
Join Date: Apr 2007
Posts: 200
Default

something like:?

Sub tbSD_GotFocus
Timer1.Interval = 10 'milliseconds
Timer1.Enabled = True
End Sub

Sub Timer1_Tick
Mean = tbMean.Text
SD = tbSd.Text
InitXaxis
Timer1.Enabled = False
End Sub

it doesnt change while waiting...
Reply With Quote
  #8 (permalink)  
Old 07-08-2007, 01:05 PM
Basic4ppc Veteran
 
Join Date: Apr 2007
Posts: 200
Default

I did it like this, but I do not think this is the most elegant solution...

Sub tbMean_GotFocus
Timer.Interval = 1000 'milliseconds
Timer.Enabled = True
End Sub

Sub tbMean_LostFocus
Timer.Enabled = False
End Sub

Sub tbSD_GotFocus
Timer.Interval = 1000 'milliseconds
Timer.Enabled = True
End Sub

Sub tbSD_LostFocus
Timer.Enabled = False
End Sub

Sub Timer_Tick
Mean = tbMean.Text
SD = tbSd.Text
InitXaxis
End Sub
Reply With Quote
  #9 (permalink)  
Old 07-08-2007, 01:38 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 1,198
Default

I was thinking more in the lines of this:

sub textbox1_gotfocus
Timer1.interval=1000
timer1.enabled=true
End Sub

Sub Timer1_Tick
Timer1.Enabled=False
somecontrol.Focus (This will raise the textbox1_lostfocus)
EndSub

Sub Textbox1_lostfocus
This is were you enter the variabl values
End Sub
__________________
Paulo Gomes
Porto, Portugal

PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD
PPC: Qtek9000, 1GB SD
Reply With Quote
  #10 (permalink)  
Old 07-08-2007, 02:42 PM
Basic4ppc Veteran
 
Join Date: Apr 2007
Posts: 200
Default

Hey, that is even more nicer. I will try that. Thanks.....
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 05:45 PM
Incorporar Drawstring y Line en TabControl Lefabrar31 Spanish Forum 1 09-13-2007 06:17 PM
DrawString in angles diferent than 0 Cableguy Basic4ppc Wishlist 0 05-05-2007 02:13 PM


All times are GMT. The time now is 11:47 PM.


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