scroll text in bar form caption (1 Viewer)

mohamedmatter

Registered User.
Local time
Today, 08:01
Joined
Oct 25, 2015
Messages
90
i want create move text in caption form move form frist bar to end move from right to left
 

Attachments

  • bandicam 2019-11-01 16-11-23-534.jpg
    bandicam 2019-11-01 16-11-23-534.jpg
    27.9 KB · Views: 39

isladogs

CID VIP
Local time
Today, 16:01
Joined
Jan 14, 2017
Messages
14,406
Not quite clear what you are asking
In form design view, type your text in the caption property.
Unless your language settings prevent it, the form caption you type will then be shown on the left of the title bar.
If you leave the caption blank, it will show the form name
 

Gasman

Enthusiastic Amateur
Local time
Today, 16:01
Joined
Sep 21, 2011
Messages
7,723
Colin,
I *think* the o/p wants to scroll the text from right to left.?

I'm sure you did exactly that with one of your forms a good while back? Is it called a Marquee effect?
 

mohamedmatter

Registered User.
Local time
Today, 08:01
Joined
Oct 25, 2015
Messages
90
Colin,
I *think* the o/p wants to scroll the text from right to left.?

I'm sure you did exactly that with one of your forms a good while back? Is it called a Marquee effect?
yes
i wants to scroll the text from right to left.?
that's rights
please hlp me
 

theDBguy

I’m here to help
Staff member
Local time
Today, 08:01
Joined
Oct 29, 2018
Messages
14,053
Colin,
I *think* the o/p wants to scroll the text from right to left.?

I'm sure you did exactly that with one of your forms a good while back? Is it called a Marquee effect?
Is this possible in the Form's caption (shown on the Title bar)?
 

Gasman

Enthusiastic Amateur
Local time
Today, 16:01
Joined
Sep 21, 2011
Messages
7,723
Is this possible in the Form's caption (shown on the Title bar)?

Well I am not the expert of course, but if you have =Marquee("Text for title bar") in the caption property, would that not do it.?

I was thinking of the Auto_Title0 in the header as well.

I've just tried a simple function and it just show my formula =Marquee("Text")

However, could it not be done in VBA with timer and adjusting the text.?

A lot of work for effect I admit, but if that is what the o/p wants.?

This wil do it. Needs more work though.

Code:
Option Compare Database
Option Explicit
Public iPos As Integer


Private Sub Form_Load()
iPos = 1
End Sub

Private Sub Form_Timer()
Dim strText As String
strText = "                   This is a test"
Me.Caption = Mid(strText, iPos, Len(strText) - iPos)
iPos = iPos + 1
End Sub
 
Last edited:

theDBguy

I’m here to help
Staff member
Local time
Today, 08:01
Joined
Oct 29, 2018
Messages
14,053
So, if a Timer is involved, wouldn't that cause quite a bit of flicker? Just curious...
 

Gasman

Enthusiastic Amateur
Local time
Today, 16:01
Joined
Sep 21, 2011
Messages
7,723
So, if a Timer is involved, wouldn't that cause quite a bit of flicker? Just curious...

Well the timer is not an event I have played with TBH, but a value of 500 seems OK.

At the end of the day, I am just offering a way that might be possible.?

It is up to the o/p if they think is is worth the effort.? and whether any flicker is soemthing they can live with.? Might even slow the form down.?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 08:01
Joined
Oct 29, 2018
Messages
14,053
Right. I can't imagine working with a form that tries to interrupt what I'm doing every half a second. This requirement may or may not be fulfilled using VBA, but I think it's better served using some API instead. Personally, I would just avoid it. Just my 2 cents...
 

Gasman

Enthusiastic Amateur
Local time
Today, 16:01
Joined
Sep 21, 2011
Messages
7,723
Right. I can't imagine working with a form that tries to interrupt what I'm doing every half a second. This requirement may or may not be fulfilled using VBA, but I think it's better served using some API instead. Personally, I would just avoid it. Just my 2 cents...

That would be my view as well. :D
 

isladogs

CID VIP
Local time
Today, 16:01
Joined
Jan 14, 2017
Messages
14,406
Ah I understand now!
You can certainly scroll text from right to left in both textboxes & labels.
As already stated the effect is called marquee text
You can see this in the following example apps: Attention Seeking Database and Password Login.

However:
a) Marquee text should only be used sparingly to get users' attention. If on all the time, the effect is irritating.
b) I've never tried to do this in the form caption. Even though its possible I really wouldn't recommend it
 

missinglinq

AWF VIP
Local time
Today, 11:01
Joined
Jun 20, 2003
Messages
6,402
Stephen Labans, as is frequently the case for matters complicated, has a hack for doing this that requires little in the way of resources, he says...and you can always take him at his word:

http://www.lebans.com/hscroller.htm

Linq ;0)>
 

theDBguy

I’m here to help
Staff member
Local time
Today, 08:01
Joined
Oct 29, 2018
Messages
14,053
Stephen Labans, as is frequently the case for matters complicated, has a hack for doing this that requires little in the way of resources, he says...and you can always take him at his word:

http://www.lebans.com/hscroller.htm

Linq ;0)>
Hi Linq. Thanks for the pointer. As I had suspected, it's better to use API for something like this. Good luck!
 

isladogs

CID VIP
Local time
Today, 16:01
Joined
Jan 14, 2017
Messages
14,406
Stephen Labans, as is frequently the case for matters complicated, has a hack for doing this that requires little in the way of resources, he says...and you can always take him at his word:
http://www.lebans.com/hscroller.htm

Hi Linq. Thanks for the pointer. As I had suspected, it's better to use API for something like this. Good luck!

I've looked at the example database on Stephen's site and, as with all his work, its very clever.
However IMHO its totally over the top for this purpose

It also scrolls text in the Access window title bar NOT the form title bar

The attached example shows how a scrolling form header caption can be achieved using the same code as for marquee text with no API required. Its a borderless form ...so no title bar



Each scroll can be run separately or at the same time.
The scroll speed can also be adjusted to suit user preference.

I doubt the resource overhead is much different in Stephen's example (based on APIs) or this one - the issue in both apps would the side effects of running a form timer whilst doing other form activity

Speaking for myself, a scrolling header or title bar would annoy me intensely .... but if that's what the OP wants ....:D
 

Attachments

  • ScrollingText_v2.zip
    324.4 KB · Views: 27
  • MainForm.PNG
    MainForm.PNG
    14.2 KB · Views: 92
Last edited:

isladogs

CID VIP
Local time
Today, 16:01
Joined
Jan 14, 2017
Messages
14,406
Updated version - this time also with scrollable form title bar caption - as originally requested by the OP.



As I said before, its not something I'd recommend but its easy enough to do ...all without using APIs

You can run each of the 3 items individually or together ...though I doubt anyone would ever actually want all 3 effects at the same time
 

Attachments

  • ScrollingText_v3.zip
    327.4 KB · Views: 29
  • MainForm_v3.PNG
    MainForm_v3.PNG
    17.3 KB · Views: 72

Users who are viewing this thread

Top Bottom