A2000 slider control/Color selector
A2000 slider control/Color selector
am 18.10.2007 20:08:45 von Karl
I trying to use the slider control in A2000.
I don't see a mouse up event and the Updated event doesn't seem to fire
after moving the slider.
I did get lost focus to work if I click on another field which I had rather
not do.
I was going to use the slider to adjust the Red, Green. Blue settings (0 to
255) for web page html built using access.
Instead, can I open the color selector in VBA instead of using the sliders?
Re: A2000 slider control/Color selector
am 18.10.2007 20:42:50 von OldPro
On Oct 18, 1:08 pm, "Karl" wrote:
> I trying to use the slider control in A2000.
>
> I don't see a mouse up event and the Updated event doesn't seem to fire
> after moving the slider.
>
> I did get lost focus to work if I click on another field which I had rather
> not do.
>
> I was going to use the slider to adjust the Red, Green. Blue settings (0 to
> 255) for web page html built using access.
>
> Instead, can I open the color selector in VBA instead of using the sliders?
See:
http://www.lebans.com/fontcolordialog.htm
Re: A2000 slider control/Color selector
am 19.10.2007 17:57:28 von Karl
Thanks
I downloaded lebans color picker and I can use it to change the back color
of a text box or a label on a form.
But if I exit the form and re-open the form, the color I picked (and which
was showing on the form just before I exited it) is not the back color of
the text box.
When the form opens, the back color of the text box is the color I last
typed into the Back Color field on the Properties sheet.(as a long)
In short, I don't seem to be able to permanently change the back color using
VBA. I can only do it by manuually entering a color (as a long) . Am I
missing something?
"OldPro" wrote in message
news:1192732970.718339.36450@i13g2000prf.googlegroups.com...
> On Oct 18, 1:08 pm, "Karl" wrote:
>> I trying to use the slider control in A2000.
>>
>> I don't see a mouse up event and the Updated event doesn't seem to fire
>> after moving the slider.
>>
>> I did get lost focus to work if I click on another field which I had
>> rather
>> not do.
>>
>> I was going to use the slider to adjust the Red, Green. Blue settings (0
>> to
>> 255) for web page html built using access.
>>
>> Instead, can I open the color selector in VBA instead of using the
>> sliders?
>
> See:
> http://www.lebans.com/fontcolordialog.htm
>
Re: A2000 slider control/Color selector
am 19.10.2007 18:29:01 von lyle
On Oct 19, 11:57 am, "Karl" wrote:
> Thanks
>
> I downloaded lebans color picker and I can use it to change the back color
> of a text box or a label on a form.
>
> But if I exit the form and re-open the form, the color I picked (and which
> was showing on the form just before I exited it) is not the back color of
> the text box.
>
> When the form opens, the back color of the text box is the color I last
> typed into the Back Color field on the Properties sheet.(as a long)
>
> In short, I don't seem to be able to permanently change the back color using
> VBA. I can only do it by manuually entering a color (as a long) . Am I
> missing something?
>
> "OldPro" wrote in message
>
> news:1192732970.718339.36450@i13g2000prf.googlegroups.com...
>
> > On Oct 18, 1:08 pm, "Karl" wrote:
> >> I trying to use the slider control in A2000.
>
> >> I don't see a mouse up event and the Updated event doesn't seem to fire
> >> after moving the slider.
>
> >> I did get lost focus to work if I click on another field which I had
> >> rather
> >> not do.
>
> >> I was going to use the slider to adjust the Red, Green. Blue settings (0
> >> to
> >> 255) for web page html built using access.
>
> >> Instead, can I open the color selector in VBA instead of using the
> >> sliders?
>
> > See:
> >http://www.lebans.com/fontcolordialog.htm
Assuming your not going to open the form in design mode, you must,
somehow, save the selected color to be used on subsequent opening of
the form.
This is how I have done it (although using my own slider written in
vba and not the color selector).
Private Sub GetCrementInterval()
Dim d As Date
On Error GoTo GetCrementIntervalErr
d = mDocument.Properties(mCrementIntervalPropertyName).Value
mCrementInterval = d - Fix(d)
mDocument.Properties(mCrementIntervalPropertyName).Value =
VBA.Date + mCrementInterval
GetCrementIntervalExit:
Exit Sub
GetCrementIntervalErr:
With Err
Dim p As Property
If .Number = 3270 Then
With mDocument
Set p = .CreateProperty(mCrementIntervalPropertyName,
_
dbDate, _
VBA.Date() + DefaultCrementInterval)
With .Properties
.Append p
.Refresh
End With
End With
Else
MsgBox .Number & vbCrLf & .Description,
vbCritical, .Source & ": GetCrementInterval"
End If
End With
mCrementInterval = DefaultCrementInterval
Resume GetCrementIntervalExit
End Sub
Private Sub SetCrementInterval(ByVal r As Single)
If r >= 1 Then r = 0.999
mDocument.Properties(mCrementIntervalPropertyName).Value =
VBA.Date + r
GetCrementInterval
End Sub
The code may not be so clear.
I have added a property to the form's properties and saved the color
there. When the form opens, it reads that value and sets the control
color to it.
Wll actually it's quite a bit more complicated than that in the
example, but that basic idea is there; store the value in a property
of the access form, or the form document depending on the version of
Access, and read it and set the color on open.
Re: A2000 slider control/Color selector
am 19.10.2007 20:22:48 von Karl
Thanks lyle
I decided to store the value in a preferences table and look it up and set
the back color when the form is opened.
"lyle" wrote in message
news:1192811341.926709.267110@v23g2000prn.googlegroups.com.. .
> On Oct 19, 11:57 am, "Karl" wrote:
>> Thanks
>>
>> I downloaded lebans color picker and I can use it to change the back
>> color
>> of a text box or a label on a form.
>>
>> But if I exit the form and re-open the form, the color I picked (and
>> which
>> was showing on the form just before I exited it) is not the back color of
>> the text box.
>>
>> When the form opens, the back color of the text box is the color I last
>> typed into the Back Color field on the Properties sheet.(as a long)
>>
>> In short, I don't seem to be able to permanently change the back color
>> using
>> VBA. I can only do it by manuually entering a color (as a long) . Am I
>> missing something?
>>
>> "OldPro" wrote in message
>>
>> news:1192732970.718339.36450@i13g2000prf.googlegroups.com...
>>
>> > On Oct 18, 1:08 pm, "Karl" wrote:
>> >> I trying to use the slider control in A2000.
>>
>> >> I don't see a mouse up event and the Updated event doesn't seem to
>> >> fire
>> >> after moving the slider.
>>
>> >> I did get lost focus to work if I click on another field which I had
>> >> rather
>> >> not do.
>>
>> >> I was going to use the slider to adjust the Red, Green. Blue settings
>> >> (0
>> >> to
>> >> 255) for web page html built using access.
>>
>> >> Instead, can I open the color selector in VBA instead of using the
>> >> sliders?
>>
>> > See:
>> >http://www.lebans.com/fontcolordialog.htm
>
> Assuming your not going to open the form in design mode, you must,
> somehow, save the selected color to be used on subsequent opening of
> the form.
>
> This is how I have done it (although using my own slider written in
> vba and not the color selector).
>
> Private Sub GetCrementInterval()
> Dim d As Date
> On Error GoTo GetCrementIntervalErr
> d = mDocument.Properties(mCrementIntervalPropertyName).Value
> mCrementInterval = d - Fix(d)
> mDocument.Properties(mCrementIntervalPropertyName).Value =
> VBA.Date + mCrementInterval
> GetCrementIntervalExit:
> Exit Sub
> GetCrementIntervalErr:
> With Err
> Dim p As Property
> If .Number = 3270 Then
> With mDocument
> Set p = .CreateProperty(mCrementIntervalPropertyName,
> _
> dbDate, _
> VBA.Date() + DefaultCrementInterval)
> With .Properties
> .Append p
> .Refresh
> End With
> End With
> Else
> MsgBox .Number & vbCrLf & .Description,
> vbCritical, .Source & ": GetCrementInterval"
> End If
> End With
> mCrementInterval = DefaultCrementInterval
> Resume GetCrementIntervalExit
> End Sub
>
> Private Sub SetCrementInterval(ByVal r As Single)
> If r >= 1 Then r = 0.999
> mDocument.Properties(mCrementIntervalPropertyName).Value =
> VBA.Date + r
> GetCrementInterval
> End Sub
>
> The code may not be so clear.
> I have added a property to the form's properties and saved the color
> there. When the form opens, it reads that value and sets the control
> color to it.
> Wll actually it's quite a bit more complicated than that in the
> example, but that basic idea is there; store the value in a property
> of the access form, or the form document depending on the version of
> Access, and read it and set the color on open.
>