-1
Good afternoon, you guys!
My question is simple and a little silly, but it’s making me crack my head.
My program has a textbox where a log is saved, at all times new data (characters) are added to this textbox. What I really care about in this log are your last 7 characters. I was thinking of using the "textbox.Selection" control to select them, the problem is that there is (as far as I know) a "Selectionend". The Selectionstart arrow command from where the selection starts and the Length how many characters this selection understands, what I need is to set where the selection should end (as I said, something like "Selectionend") and use "Selectionlength" to set that it is from this point up to 7 characters ago that the selection must understand. How can I do this as simply as possible? These last 7 characters will be used as log file name in automatic saving of the same.
Follow code for auto save. (where my problem is)
{
CaptureInfo.CaptureFrame();
textBox1.SelectionStart = 99999;
textBox1.SelectionLength = -7;
Thread.Sleep(1000);
caminhoImagemSalva = @"\\172.21.xxx.xxx\Impresa tal\Arquivo Digital\Arquivo de imagem atendimento\Guichê 04\"
+ "Atendente 04"
+ " "
+ textBox1.SelectedText
+ " "
+ DateTime.Now.Day.ToString()
+ "."
+ DateTime.Now.Month.ToString()
+ "."
+ DateTime.Now.Year.ToString()
+ " as "
+ DateTime.Now.Hour.ToString()
+ "h"
+ DateTime.Now.Minute.ToString()
+ "min"
+ ".jpg";
picWebCam.Image.Save(caminhoImagemSalva, ImageFormat.Jpeg);
}
Thank you in advance!
If you know the size of the text in Textbox and how many you want to grab it is easy to know which is the start.
– ramaral
In the case in question the textbox does not have a predefined size.
– Informatica 6drp
I don’t understand... what do you want with this? Capture this content or make it available on the clip board?
– Leandro Angelo