locked
rectangle from GetRectFromCharacterIndex has negative height and cursor position not right

    Question

  • I create a test demo for this question and you can get it from my one drive.

    There are two problems:

    1. Method GetRectFromCharacterIndex  of TextBox returun a rectangle but sometimes the rectangle has negative value. You can  see in my code i add a if check to see if the height is negative.
    2. If you input some text to the TextBox and press enter, the TextBox will auto-extend, but the cursor is in the head of last line other than the new line.

    For problem one, I find a same question. There is an answer tells to call this function after Render, but i don't know where can i find the render event. Could anyone tell me more detail?

    Thanks a lot.

    Tuesday, December 02, 2014 12:41 PM

All replies

  • Hi Jeromeee,

    >> 1.Method GetRectFromCharacterIndex  of TextBox returun a rectangle but sometimes the rectangle has negative value. You can  see in my code i add a if check to see if the height is negative.

    I can get negative height when I input enter in the last position of the text, but it works ok in other position of the text. I will check for this issue and let you know the result later.

    >> 2.If you input some text to the TextBox and press enter, the TextBox will auto-extend, but the cursor is in the head of last line other than the new line.

    Yes, it looks like in the head of the last line, but in fact it is in his position. When you continue to input something, you will see it in the right position.

    Please feel free to let me know if you have any concerns.

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.

    Wednesday, December 03, 2014 6:21 AM
    Moderator
  • Hi Jeromeee,

    >> 1.Method GetRectFromCharacterIndex  of TextBox returun a rectangle but sometimes the rectangle has negative value. You can  see in my code i add a if check to see if the height is negative.

    I can get negative height when I input enter in the last position of the text, but it works ok in other position of the text. I will check for this issue and let you know the result later.

    >> 2.If you input some text to the TextBox and press enter, the TextBox will auto-extend, but the cursor is in the head of last line other than the new line.

    Yes, it looks like in the head of the last line, but in fact it is in his position. When you continue to input something, you will see it in the right position.

    Please feel free to let me know if you have any concerns.

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.

    Hi Herro,

    I know it's indeed in the head of the last line, but the user experience is not that good. I hope the outlook can be consistent with it's real position. Could it be possible?

    Thursday, December 04, 2014 10:15 AM
  • Hi Jeromeee,

    I will use internal channel to check if the two problems are known issue or by design. I will let you know my result if I get something useful later.

    Thank you for reporting this issue!

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.

    Friday, December 05, 2014 9:03 AM
    Moderator
  • Hi Jeromeee,

    I will use internal channel to check if the two problems are known issue or by design. I will let you know my result if I get something useful later.

    Thank you for reporting this issue!

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.


    That's great. Thanks for your time. Waiting for your result.
    Saturday, December 13, 2014 6:42 AM