Hi to all,
i have a richtextbox full of letters.A message is written by the user in another textbox.This message is embedded into the generted letters in richtextbox by certain keys.Any ideas on how i can make this process which i 've already done be dispalyed in SLOW MOTION.............tnx
Displaying in slow motion
Page 1 of 16 Replies - 1719 Views - Last Post: 26 April 2009 - 04:07 AM
Replies To: Displaying in slow motion
#2
Re: Displaying in slow motion
Posted 23 April 2009 - 02:44 PM
mil1234, on 23 Apr, 2009 - 12:39 PM, said:
Hi to all,
i have a richtextbox full of letters.A message is written by the user in another textbox.This message is embedded into the generted letters in richtextbox by certain keys.Any ideas on how i can make this process which i 've already done be dispalyed in SLOW MOTION.............tnx
i have a richtextbox full of letters.A message is written by the user in another textbox.This message is embedded into the generted letters in richtextbox by certain keys.Any ideas on how i can make this process which i 've already done be dispalyed in SLOW MOTION.............tnx
Yes. Simply create a function which will pause for a brief period of time, create a for->next loop for transferring the text letter by letter, with a call to the pause function in between. Eg:
Public Function wait(Optional ByVal mSeconds As Decimal = 0.01) Dim endTime As Date = Date.Now.AddSeconds(mSeconds) Do : Loop Until Date.Now > endTime Return 0 End Function Private Sub XferText() For i = 0 to Len(text1.text) 'Add code to move the letter based on the position of 'i' wait() '<-slight pause in between Next i End Sub
#3
Re: Displaying in slow motion
Posted 25 April 2009 - 04:06 AM
[quote name='jurdendurden' date='23 Apr, 2009 - 01:44 PM' post='617064']
Yes. Simply create a function which will pause for a brief period of time, create a for->next loop for transferring the text letter by letter, with a call to the pause function in between. Eg:
Hi friend thanks for that but i can't really understand how can this work for me.I have this line of code which i need to be executed:
This line of code is getting all the functions made by me so that the message in textbox 1 is inserted according to the functions in the encryption class in the richtextbox1.What i need is to make this process in slow motion.Can u help me please or we try to implement that line of code in your code given to me??or maybe with another method.tnx
mil1234, on 23 Apr, 2009 - 12:39 PM, said:
Hi to all,
i have a richtextbox full of letters.A message is written by the user in another textbox.This message is embedded into the generted letters in richtextbox by certain keys.Any ideas on how i can make this process which i 've already done be dispalyed in SLOW MOTION.............tnx
i have a richtextbox full of letters.A message is written by the user in another textbox.This message is embedded into the generted letters in richtextbox by certain keys.Any ideas on how i can make this process which i 've already done be dispalyed in SLOW MOTION.............tnx
Yes. Simply create a function which will pause for a brief period of time, create a for->next loop for transferring the text letter by letter, with a call to the pause function in between. Eg:
Public Function wait(Optional ByVal mSeconds As Decimal = 0.01) Dim endTime As Date = Date.Now.AddSeconds(mSeconds) Do : Loop Until Date.Now > endTime Return 0 End Function Private Sub XferText() For i = 0 to Len(text1.text) 'Add code to move the letter based on the position of 'i' wait() '<-slight pause in between Next i End Sub
Hi friend thanks for that but i can't really understand how can this work for me.I have this line of code which i need to be executed:
RichTextBox1.Text = Encryption.encrypt(r, pre, post, TextBox1.Text)
This line of code is getting all the functions made by me so that the message in textbox 1 is inserted according to the functions in the encryption class in the richtextbox1.What i need is to make this process in slow motion.Can u help me please or we try to implement that line of code in your code given to me??or maybe with another method.tnx
#4
Re: Displaying in slow motion
Posted 25 April 2009 - 04:35 AM
simply use the following code
Application.DoEvents()
#5
Re: Displaying in slow motion
Posted 25 April 2009 - 09:11 AM
noorahmad, on 25 Apr, 2009 - 03:35 AM, said:
simply use the following code
Application.DoEvents()
Hi tnx for the help.But lets suppose i'm generating 200 charaters by clicking a button in a textbox.How can i see by slow motion the characters being generated one by one going in the textbox?? (u know that if we generate 200 characters they are put as a chunk altoghether in the textbox.Now what i want is to achieve them one by one--seeing them being written??!!!
#6
Re: Displaying in slow motion
Posted 25 April 2009 - 09:24 PM
i cant get you question clearly but i think you should use
if you post you code here then i will help you better.
and thanks
System.Threading.Thread.Sleep(1000) 'in milliseconds
if you post you code here then i will help you better.
and thanks
#7
Re: Displaying in slow motion
Posted 26 April 2009 - 04:07 AM
Ok, letīs assume:
- You have a text box (source) called sourceText
- You have another text box (slowmo target, you have RTF, but it is easy to change) called targetText
- You have a timer called slowmoTimer, disabled, interval - any that you want
- You have a button which is going to start the process (as it canīt delete letters, it will have to start alway from empty textbox) called startButton
So, the startButton will enable the slowmoTimer and set targetText.Text = "", no big deal.
And now, the slowmoTimerīs tick function:
Sorry if I did any mistake or something...
I actually didnīt test or write this in VB, so...
You will maybe need to use targetText.Text.Lenght() - 1
- You have a text box (source) called sourceText
- You have another text box (slowmo target, you have RTF, but it is easy to change) called targetText
- You have a timer called slowmoTimer, disabled, interval - any that you want
- You have a button which is going to start the process (as it canīt delete letters, it will have to start alway from empty textbox) called startButton
So, the startButton will enable the slowmoTimer and set targetText.Text = "", no big deal.
And now, the slowmoTimerīs tick function:
Private Sub blah blah handles blah blah If (sourceText.Text = targetText.Text) Then MsgBox "Finished" slowmoTimer.Enabled = false ' Finished! Else Dim addTo As Integer = targetText.Text.Lenght() targetText.Text = targetText.Text & sourceText.Text.Chars(addTo) End If End Sub
Sorry if I did any mistake or something...
I actually didnīt test or write this in VB, so...
You will maybe need to use targetText.Text.Lenght() - 1
This post has been edited by Aurel300: 26 April 2009 - 04:08 AM
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote




|