Hi
Is following behavior possible with yor TextBox (Like MSForms TextBox)
1) TextBox with Multiline enabled
Lets say there are 5 lines text in textbox.
Cursor is on first line, user presses Down key on keyboard, cursor is moved to the next line.
When curos is on the last line and user presses Down, focus is sent to the next control (Like Tab)
BR;
Meelis
UpDown->Tab Behavior
Re: UpDown->Tab Behavior
There is no such built-in feature, but you can use the KeyDown event, the GetSelection method, the GetLineFromChar method and the GetLineCount method to check whether the cursor is in the last line. Then you should be able to fake a Tab key press using SendKeys or keybd_event or SendInput.
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!
Boycott DRM! Boycott HDCP!
Re: UpDown->Tab Behavior
Hi Timo
Ok i found a solution.
Im using SendMessage APi and EM_LINEFROMCHAR message to find current line and then i set focus to previous or next textbox, when cursor is on last or first line.
What im also missing is Locked property like in MSForms TextBox.
One more thing i noticed - i think its not a bug but it works with MSForms controls.
Lets say i have 5 textboxes on PictureBox.
With MSForms controls when you press Tab key, focus is set to the next control. When last control is in focus then Tab press has no effect(goes not outside container)
but with your TextBox it goes outside the container.
Alles gute;
Meelis
Ok i found a solution.
Im using SendMessage APi and EM_LINEFROMCHAR message to find current line and then i set focus to previous or next textbox, when cursor is on last or first line.
What im also missing is Locked property like in MSForms TextBox.
One more thing i noticed - i think its not a bug but it works with MSForms controls.
Lets say i have 5 textboxes on PictureBox.
With MSForms controls when you press Tab key, focus is set to the next control. When last control is in focus then Tab press has no effect(goes not outside container)
but with your TextBox it goes outside the container.
Alles gute;
Meelis
Re: UpDown->Tab Behavior
So you are doing the same as I suggested in my previous post, but using the API. Internally, the TextBox methods that I mentioned also use SendMessage and EM_LINEFROMCHAR and so on.Mex wrote:Ok i found a solution.
Im using SendMessage APi and EM_LINEFROMCHAR message to find current line and then i set focus to previous or next textbox, when cursor is on last or first line.
What does it do? I don't have any MS Office product, so I don't have MS Forms 2.0 to look it up myself. There's a ReadOnly property, maybe this is what you're looking for.Mex wrote:What im also missing is Locked property like in MSForms TextBox.
I would call this a bug of MS Forms controls. The normal behavior of ActiveX controls is that the focus can go outside the container.Mex wrote:One more thing i noticed - i think its not a bug but it works with MSForms controls.
Lets say i have 5 textboxes on PictureBox.
With MSForms controls when you press Tab key, focus is set to the next control. When last control is in focus then Tab press has no effect(goes not outside container)
but with your TextBox it goes outside the container.
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!
Boycott DRM! Boycott HDCP!
Re: UpDown->Tab Behavior
Hi
U can download http://www.deltmar.ee/riks/download/setuppad.exe
Microsoft ActiveX Control Pad, this setup contains MSForms controls.
Meelis
U can download http://www.deltmar.ee/riks/download/setuppad.exe
Microsoft ActiveX Control Pad, this setup contains MSForms controls.
Meelis
Re: UpDown->Tab Behavior
It can't be installed on Windows 7 64 Bit.
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!
Boycott DRM! Boycott HDCP!