Question about Edit control ...

7 posts in this topic

enaiman 14

I'm working on a serial communication between my computer and a switch over COM1.

I'm using a big edit control for displaying the sent and received text.

It works fine except when I need to receive like 100 characters in 50 seconds (the time between characters is around 0.5 sec) - e.g. when I'm performing a save and the switch shows the progress by sending 1 ">" character every .5 sec.

The problem is that the only way to refresh the information in the edit box is to read content & add received characters & set control data using the new string. It can handle that but it looks like an inefficient way to do it and i can see some "flickering" during this process.

Question: Is there another way to "add" text to an edit without using GUICtrlSetData?

Share this post

Link to post

Share on other sites

martin 66

The problem is that the only way to refresh the information in the edit box is to read content & add received characters & set control data using the new string. It can handle that but it looks like an inefficient way to do it and i can see some "flickering" during this process.

Question: Is there another way to "add" text to an edit without using GUICtrlSetData?

If you include guiedit.au3 then the function _GUICtrlEditReplaceSel can be used to insert text at the cursor, so you just need to ensure the cursor is at the end of the text.

BTW you have a line

_CommPortConnection()

This function returns the com port currently connected but since you are doing nothing with it it might as well be removed.