dxut: keeping carent in editbox

sorry if im being a pest but one more thing is there a way to keep the Caret with in the editbox control
if you type in the editbox control the Caret moves all the way off the screen, I have tried seting many different properties and mothing seems to work.
thanks a bunch


Answer this question

dxut: keeping carent in editbox

  • Johan Strand

    Repro is easy. Take Aug SDK, Custom UI sample. Start typing at the end of the textbox right in the middle of the screen. Watch the cursor fly out of the text box and off the screen.

    Note: This only occurs in the C# version of the sample. THe C++ version works as expected.

    Note2: The C# code actually documents this in dxmutgui.cs
    EditBox::FocusText()

    // Because of a design issue with the rich text box control that is used as
    // the backing store for this control, the 'scrolling' mechanism built into
    // the control will only work if the control has focus. Setting focus to the
    // control here would work, but would cause a bad 'flicker' of the application.
    // Therefore, the automatic horizontal scrolling is turned off by default. To
    // enable it turn this define on.
    #if (SCROLL_CORRECTLY)
    NativeMethods.SetFocus(textData.Handle);
    NativeMethods.SetFocus(Parent.SampleFramework.Window);
    #endif

    However if you define SCROLL_CORRECTLY, it no longer compiles since NativeMethods.SetFocus is not defined.



  • Graeme

    Bug confirmed.  Look for a future SDK release to fix this problem.



  • Cyrus

    Hmm, that sounds like a bug but I can't repoduce it.  The caraet should be shown in the editbox where the insert point is, just like the GDI standard editbox. 

    Can you send your dxdiag.txt and SDK version to directx@microsoft.com

    Thanks,
    Jason

  • Miran

    I was searching to see if there was a fix to this problem, and my question is this still going to show up in a sdk update
  • dxut: keeping carent in editbox