thisForm.Timer

thisForm.Timer

Post by Rick Hodgi » Wed, 17 May 2000 04:00:00



Does anyone have experience with a Timer object on the same form as a
ComboBox object?

I have found that my Timer causes the combo box objects to not work
correctly 100% of the time.  They seem to work sporadically.  When the Timer
is disabled then everything works just as it should.

Anyone encounter this problem?

- Rick C. Hodgin

I'm using VFP 5.0 on Windows NT 4.0, sp6.

 
 
 

thisForm.Timer

Post by Em Ber » Wed, 17 May 2000 04:00:00


I have many forms with both comboboxes and timers, and have never
experienced any problems with the comboboxes. How often do your timers fire?
How cpu intensive is the code they run? How fast is your cpu? How much
memory?


Quote:> Does anyone have experience with a Timer object on the same form as a
> ComboBox object?

> I have found that my Timer causes the combo box objects to not work
> correctly 100% of the time.  They seem to work sporadically.  When the
Timer
> is disabled then everything works just as it should.

> Anyone encounter this problem?

> - Rick C. Hodgin

> I'm using VFP 5.0 on Windows NT 4.0, sp6.


 
 
 

thisForm.Timer

Post by Tim Witor » Thu, 18 May 2000 04:00:00



> Does anyone have experience with a Timer object on the same form as a
> ComboBox object?

> I have found that my Timer causes the combo box objects to not work
> correctly 100% of the time.  They seem to work sporadically.  When the Timer
> is disabled then everything works just as it should.

> Anyone encounter this problem?

> - Rick C. Hodgin

> I'm using VFP 5.0 on Windows NT 4.0, sp6.

Nope.  Just about every one of my forms has a timer on it and
I've never had odd comboBox behavior.  As Em Bert wrote,
it could be related to the timer settings.  If you set it
to something insane like 1 and the timer code takes more
than a millisecond, just about nothing will work right.

-- TRW
_______________________________________
My e-mail:  t r w 7

_______________________________________

 
 
 

thisForm.Timer

Post by Rick Hodgi » Thu, 18 May 2000 04:00:00


Quote:> I have many forms with both comboboxes and timers, and have never
> experienced any problems with the comboboxes. How often do your timers
fire?
> How cpu intensive is the code they run? How fast is your cpu? How much
> memory?

It's set to fire every .5 seconds (500 milliseconds).  The timer is setup to
modify the appearence of some sample text on the screen.  The settings on
this form allow the user to customize the font attributes for a specific
part of a program.  Here is the timer code.

Sample_text is a Label object.  font_size and font_attrib are character
variables.  Font_size is usually something like "10" or "12" and font_attrib
is usually "B", for bold.  It can be "BIU" for Bold, Italics and Underline.

    thisForm.sample_text.FontSize = val(m.font_size)
    if "B" $ upper(m.font_attrib)
        thisForm.sample_text.FontBold = .t.
    else
        thisForm.sample_text.FontBold = .f.
    endif
    if "I" $ upper(m.font_attrib)
        thisForm.sample_text.FontItalic = .t.
    else
        thisForm.sample_text.FontItalic = .f.
    endif
    if "U" $ upper(m.font_attrib)
        thisForm.sample_text.FontUnderline = .t.
    else
        thisForm.sample_text.FontUnderline = .f.
    endif
    thisForm.sample_text.FontName = m.font_name

When I disable the timer it works correctly.  When I re-enable the timer it
does not.  I've since disabled the timer and set the LostFocus method on all
other objects that the user can tab to to trigger the thisForm.Timer1.Timer
event.  It works just as it should.

If anyone is interested I can e-mail the entire form and a sample program
which reproduces the error.

- Rick C. Hodgin

 
 
 

thisForm.Timer

Post by Tim Witor » Fri, 19 May 2000 04:00:00



> > I have many forms with both comboboxes and timers, and have never
> > experienced any problems with the comboboxes. How often do your timers
> fire?
> > How cpu intensive is the code they run? How fast is your cpu? How much
> > memory?

> It's set to fire every .5 seconds (500 milliseconds).  The timer is setup to
> modify the appearence of some sample text on the screen.  The settings on
> this form allow the user to customize the font attributes for a specific
> part of a program.  Here is the timer code.

> Sample_text is a Label object.  font_size and font_attrib are character
> variables.  Font_size is usually something like "10" or "12" and font_attrib
> is usually "B", for bold.  It can be "BIU" for Bold, Italics and Underline.

>     thisForm.sample_text.FontSize = val(m.font_size)
>     if "B" $ upper(m.font_attrib)
>         thisForm.sample_text.FontBold = .t.
>     else
>         thisForm.sample_text.FontBold = .f.
>     endif
>     if "I" $ upper(m.font_attrib)
>         thisForm.sample_text.FontItalic = .t.
>     else
>         thisForm.sample_text.FontItalic = .f.
>     endif
>     if "U" $ upper(m.font_attrib)
>         thisForm.sample_text.FontUnderline = .t.
>     else
>         thisForm.sample_text.FontUnderline = .f.
>     endif
>     thisForm.sample_text.FontName = m.font_name

> When I disable the timer it works correctly.  When I re-enable the timer it
> does not.  I've since disabled the timer and set the LostFocus method on all
> other objects that the user can tab to to trigger the thisForm.Timer1.Timer
> event.  It works just as it should.

> If anyone is interested I can e-mail the entire form and a sample program
> which reproduces the error.

> - Rick C. Hodgin

This may have absolutely no effect on your problem, but it
is still a good idea...

When you are changing a bunch of on-screen stuff in one spot,
it's usually a good idea to surround the code in a ThisForm.Lockscreen =
.T.
and a ThisForm.Lockscreen = .F.  It makes for a snappier appearing
update.

-- TRW
_______________________________________
My e-mail:  t r w 7

_______________________________________