Is there a method to set the caret position within a RichEditableText control?
The control's contents can contain errors that the user must fix which are navigated though via Next/Previous buttons, and during the navigation I would like to set the caret cursor to the end of each error within the text.
First you need to change the focus:
textField.setFocus()
Then set the positoin:
textField.selectRange()
Related
i'd like to add a TapGestureRecognizer to an OxyPlot PlotView. The tap is only recognized when point is outside of the graph area, just on the borders. It is not fired when tapping in the middle of the graph.
What am I missing?
You have to add the following property
InputTransparent="true" to the oxyPlot in XAML
From the docs
Gets or sets a value indicating whether this element should be involved in the user interaction cycle. This is a bindable property.
false if the element and its children should receive input; true if neither the element nor its children should receive input and should, instead, pass inputs to the elements that are visually behind the current visual element. Default is false.
I have a Div that holds a RadioButtonList with 2 values and a required field validator.
As you can see the validator wraps to the next line (Circled). I am trying to get it to display next to the RadioButtonList (where the red dot is). No matter what I do it remains on the next line.
I have made the cell wider with no effect. I have set Display to Dynamic, no effect. With all the other controls on the form (textboxes & Drop downs) the validator displays correctly but this one wont. It is the same in Design mode as it is when I run the app.
On the RadioButtonList I set RepeatDirection to Flow. Its fixed the problem.
I think the size of the div where you place the radio button control is small.Can you please increase the size of that div.
I want to display a note to the user whenever the focus comes to a particular textbox i have written the note in a div and set its visibility to false what to do next
Instead of your div, put that text into a ToolTip property on the textbox control and ASP.NET will take care of it for you.
Here's the scenario: I wait for a creationComplete event to occur for an mx:Text object at which point I can access the setTextFormat method of its protected member textField. (textField is not valid until creationComplete.) At that point the text formatting done through textField.setTextFormat increases the height of the text. But the mx:Text itself does not pick up this height change until I call invalidateSize. However, in my case invalidateSize causes the entire text to be redrawn, causing it to flash on the screen. However, if I just manually change the browser window size, the Text height change is made without the text flashing like that. So how could I through a function call accomplish what is taking place when I manually change the browser window size. (I just want mx:Text to pick up the height change accomplished through textfield.setTextFormat.)
did you tried to put your textfield inside a sprite or movieclip and scale it with your callback?
to invertedspear
I was in fact able to avoid the screen flash by calling
txt1.invalidateSize();
txt1.validateNow();
immediately after the calls to txt1.ui_txtfld().setTextFormat(....)
(ui_txtfld() is how I'm making the protected property textField visible.)
However, elsewhere in my code, it was also necessary to not reference txt1.height directly, but instead,
(txt1.ui_txtfld().textHeight+4)*txt1.scaleY,
as the txt1.textField.textHeight property is valid immediately after changing the height of a textField, whereas txt1.height is not.
I work on a Flex app that loads external Flash resources created in CS3. I've just been reading about how I can use the Flex mx.managers.CursorManager class to change the mouse cursor explicitly. But what I'd ideally like to do is to set a mouse cursor property on some elements in the loaded Flash SWF, so as the cursor passes over this element the cursor automatically changes without me having to respond to mouse events.
Is it possible? Does Flash support this in DisplayObject or something?
It seems the Flash SWF is overriding me. Some objects automatically display the hand cursor with mouse-over, and I can't see a way to turn this off on a DisplayObject?
To set the the "Hand" cursor, as soon as the mouse hovers over a element you have to specify these properties:
<mx:VBox
useHandCursor="true"
mouseChildren="false"
buttonMode="true">
However this only works for the Hand cursor. Also take care of the required mouseChildren attribute. You either have to set this to false to achieve the cursor for all contained items or you have to specify the attributes useHandCursor and buttonMode for all elements. However the side effect of settings mouseChildren to false is that all mouse events (mouseOver, mouseOut, click,...) on child elements will no longer work.
In case you want to use a different cursor than the hand cursor I am afraid you have only two possibilities:
Replace the standard hand cursor by your cursor
Use the mouseOver and mouseOut events to set the cursor programmatically.
In any object inheriting from Sprite whose buttonMode and useHandCursor properties are both true, you'll get a hand cursor by default when you roll over it. Some objects do this by default, correct; Button and LinkButton are examples you've probably noticed. Simply setting useHandCursor to false on any of these components will disable the hand cursor easily enough, even when its buttonMode property (which is responsible for dispatching click events) is set to true.
If you want to set your cursor to anything else on mouseOver, though, you'll have to respond to mouse events; there's no way around that. Depending on your design goal, you could break that work out somehow, maybe by inheriting from some other object and then overriding its default behavior, but in some form or other, the runtime needs to know you want those mouse events handled.