Search Results

Search found 4289 results on 172 pages for 'focus stealing'.

Page 15/172 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • Set the focus on a textbox in xaml wpf

    - by devnet247
    Hi dispite some posts on this forum and others i cannot find something that tells me how to set the focus on a text box. I have a userControl with many labels and textBoxes.When the form is loaded I want the a particular textBox to have the focus. I have set the tabIndex but that didnt seem to work. Any suggestions

    Read the article

  • How to override the focus on page in greasmonkey

    - by nimo
    After the page has loaded a piece of javascript set focus on window and on a specific input field. I want to prevent this focus on the input field how can I do that with javascript in greasemonkey? Maybe this is not possible because greasemonkey don't execute the code until the entire page has loaded? Then let's say I can run my code at any time how can I prevent the focusing?

    Read the article

  • Set focus on particular tab in IE and/or FireFox

    - by Jack Juiceson
    Hi all, I want to write an application that will monitor the content of all open tabs in IE / FireFox and trigger event once particular data is displayed in the tab. I would like to know if there is an API for IE/FF to set focus on particular TAB, so that once event is triggered I set focus on a relevant tab. Thanks in advance

    Read the article

  • Focus on input field with value

    - by Marcel
    Hi, i am focusing on an input field with jquerys $("input:text").focus(); There is allready some textvalue in the inputfield. When I focus, the cursor blinks right after the last letter, how would I put the cursor right in front of the first letter? thx alot

    Read the article

  • How do I get this validationTextBox to focus?

    - by Anurag Chaudhury
    After performing an ajax request if the input in the form was wrong I am trying to get this validatationTextBox to be focussed on and display an indicator message showing the problem. The code is: dijit.byId("passwordField").focusNode.focus() The form element is as mentioned a validationTextBox. The matter that is confusing me even further is that before in dojo 1.5, this piece of code was simply dijit.byId("passwordField").focus() and this worked fine. How can I fix this?

    Read the article

  • Vista: window focus problem

    - by GateKiller
    Sorry for the vague title but this one is hard to explain so bear with me please. I'm using Windows Vista at work for web development and sometimes when I Click or Alt-Tab to background window, the window will get focus but it will not be brought to the front. In order to bring the window to the front, I have to click on the applications border (when the resize cursor appears) and the window will then jump to the front. I've had this problem for about a year now and it happens at least a dozen times a day, but it doesn't do this all the time - seems random. I hope I have explained the issue fully (and you've understood it) and would appreciate any constructive answers or comments to solve this problem. Example: If I Alt-Tab from Google Chrome to Notepad and this problem randomly occurs, Google Chrome will remain in front of Notepad, however, I will be able to type text into Notepad while the window is behind Google Chrome. Clicking on Notepad's content area will not bring it to the front but clicking it's window border will. Video Exampe http://vimeo.com/19388998 In this video, I clicked from Google Chome to UltraEdit and chrome stayed in font, but as you can see, I can still type in UltraEdit. I'm starting to believe that this could be a bug in Google Chrome so I'll continue to watch if this between other applications.

    Read the article

  • Why does the task pictogram flashes instead of opening the program?

    - by fredley
    Sometimes, when I select a click a program on the Windows 7 taskbar it won't appear (it doesn't gain focus and remains behind other open windows), and the icon will flash and turn orange. This happens reasonably frequently, and I've had it happen on two separate Windows installs on different machines. It just happened now and the only programs I have with active windows are Chrome, WMP and Explorer (2). It happened when I clicked Explorer. Once this has happened to one window, it affects all windows, and the only way I can switch between programs is by finding the window manually or using Windows+Tab. The only way I've come across to get the computer to snap out of this annoying behaviour is to restart the machine. Is there a way of stopping it? Edit Here's a video of it happening: http://www.youtube.com/watch?v=P12OxKK0kM4

    Read the article

  • auto Focus (Hit Enter) Javascript function is working good in IE7 but not working in IE8

    - by James123
    Hi, I used a javascript FocusChange() in my aspx page. I have couple of controls and I need Hit enter key need to move next control based on tab index. It is working good in IE7 but not working in IE8... Please help me on this.. Thanks for your help in advance. The java script is given below. function FocusChange() { if (window.event.keyCode == 13) { var formLength = document.form1.length; // Get number of elements in the form var src = window.event.srcElement; // Gets the field having focus var currentTabIndex = src.getAttribute('tabindex'); // Gets its tabindex // scroll through all form elements and set focus in field having next tabindex for (var i = 0; i < formLength; i++) { if (document.form1.elements[i].getAttribute('tabindex') == currentTabIndex + 1) { for (var j = i; j <= formLength; j++) { if (document.form1.elements[j].disabled == false) { document.form1.elements[j].focus(); event.returnValue = false; event.cancel = true; return; } } } } } }

    Read the article

  • Windows Forms: Unable to Click to Focus a MaskedTextBox in a Non TopLevel Form

    - by Overhed
    Like the title says, I've got a Child form being shown with it's TopLevel property set to False and I am unable to click a MaskedTextBox control that it contains (in order to bring focus to it). I can bring focus to it by using TAB on the keyboard though. The child form contains other regular TextBox controls and these I can click to focus with no problems, although they also exhibit some odd behavior: for example if I've got a value in the Textbox and I try to drag-click from the end of the string to the beginning, nothing happens. In fact I can't use my mouse to move the cursor inside the TextBox's text at all (although they keyboard arrow keys work). I'm not too worried about the odd TextBox behavior, but why can't I activate my MaskedTextBox by clicking on it? Below is the code that shows the form: Dim newReportForm As New Form Dim formName As String Dim FullTypeName As String Dim FormInstanceType As Type formName = TreeView1.SelectedNode.Name FullTypeName = Application.ProductName & "." & formName FormInstanceType = Type.GetType(FullTypeName, True, True) newReportForm = CType(Activator.CreateInstance(FormInstanceType), Form) Try newReportForm.Top = CType(SplitContainer1.Panel2.Controls(0), Form).Top + 25 newReportForm.Left = CType(SplitContainer1.Panel2.Controls(0), Form).Left + 25 Catch End Try newReportForm.TopLevel = False newReportForm.Parent = SplitContainer1.Panel2 newReportForm.BringToFront() newReportForm.Show()

    Read the article

  • Retrieve a TextBox element dinamically created and Focus it

    - by user335444
    Hi, I have a collection (VariableValueCollection) of custom type VariableValueViewModel objects binded with a ListView. WPF Follow: <ListView ItemsSource="{Binding VariableValueCollection}" Name="itemList"> <ListView.Resources> <DataTemplate DataType="{x:Type vm:VariableValueViewModel}"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="180"></ColumnDefinition> </Grid.ColumnDefinitions> <TextBox TabIndex="{Binding Path=Index, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" Grid.Column="0" Name="tbValue" Focusable="True" LostFocus="tbValue_LostFocus" GotFocus="tbValue_GotFocus" KeyDown="tbValue_KeyDown"> <TextBox.Text> <Binding Path="Value" UpdateSourceTrigger="PropertyChanged" Mode="TwoWay"> <Binding.ValidationRules> <ExceptionValidationRule></ExceptionValidationRule> </Binding.ValidationRules> </Binding> </TextBox.Text> </TextBox> </Grid> </DataTemplate> </ListView.Resources> </ListView> My Goal is to add a new row when I press "enter" on last row, and Focus the new row. To do that, I check that row is the last row and add a new row in that case. But I don't know how to focus the new TextBox... Here the KeyPressed method: private void tbValue_KeyDown(object sender, KeyEventArgs e) { if (e.Key == System.Windows.Input.Key.Enter) { DependencyObject obj = itemList.ContainerFromElement((sender as TextBox)); int index = itemList.ItemContainerGenerator.IndexFromContainer(obj); if( index == (VariableValueCollection.Count - 1) ) { // Create a VariableValueViewModel object and add to collection. In binding, that create a new list item with a new TextBox ViewModel.AddNewRow(); // How to set cursor and focus last row created? } } } Thank's in advance...

    Read the article

  • C++ wxWidgets Event (Focus) Handling

    - by Wallter
    Due to comments I added the following code (in BasicPanel) Connect(CTRL_ONE, wxEVT_KILL_FOCUS, (wxObjectEventFunction)&BasicPanel::OnKillFocus); Connect(CTRL_TWO,wxEVT_KILL_FOCUS, (wxObjectEventFunction)&BasicPanel::OnKillFocus); Connect(CTRL_THREE, wxEVT_KILL_FOCUS, (wxObjectEventFunction)&BasicPanel::OnKillFocus); Connect(CTRL_FOUR, wxEVT_KILL_FOCUS, (wxObjectEventFunction)&BasicPanel::OnKillFocus); Connect(CTRL_FIVE, wxEVT_KILL_FOCUS, (wxObjectEventFunction)&BasicPanel::OnKillFocus); (enums) CTRL_NAME = wxID_HIGHEST + 5, // 6004 CTRL_ADDRESS = wxID_HIGHEST + 6, // 6005 CTRL_PHONENUMBER = wxID_HIGHEST + 7, // 6006 CTRL_SS = wxID_HIGHEST + 8, // 6007 CTRL_EMPNUMBER = wxID_HIGHEST + 9 // 6008 (The OnKillFocus Function - the declaration is included as suggested) void BasicPanel::OnKillFocus(wxFocusEvent& event) { switch (event.GetId()) { case 6004: ... break; ... ... ... } All of these added to the code do nothing when the user changes focus on which text box they are using... Q1:I am using wxWidgets (C++) and have come accost a problem that i can not locate any help. I have created several wxTextCtrl boxes and would like the program to update the simple calculations in them when the user 'kills the focus.' I could not find any documentation on this subject on the wxWidgets webpage and Googling it only brought up wxPython. The two events i have found are: EVT_COMMAND_KILL_FOCUS - EVT_KILL_FOCUS for neither of which I could find any snippet for. Could anyone give me a short example or lead me to a page that would be helpful? Q2:Would i have to create an event to handle the focus being killed for each of my 8 wxTextCtrl boxes? In the case that i have to create a different event: How would i get each event to differentiate from each other? I know i will have to create new wxID's for each of the wxTextCtrl boxes but how do I get the correct one to be triggered? class BasicPanel : public wxPanel { ... wxTextCtrl* one; wxTextCtrl* two; wxTextCtrl* three; wxTextCtrl* four; ... }

    Read the article

  • Custom android preference type loses focus when typing

    - by Brian
    I created a simple preference class that shows an AutoCompleteTextView control and it displays properly but when i focus on the AutoCompleteTextView and start typing it brings up the keyboard but then immediately loses focus on the control. Any idea why this loses focus? Here's what i did to create the view. the inflated layout is just a basic linear layout with a title textview in it. I could change it to a dialog preference instead I guess but it'd be smoother if it could be part of the base view. @Override protected View onCreateView(ViewGroup parent) { LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); LinearLayout layout = (LinearLayout) inflater.inflate(R.layout.base_preference, null); if (mHint != null) { TextView hintView = (TextView) layout.findViewById(R.id.PreferenceHintTextView); hintView.setText(mHint); } TextView titleView = (TextView) layout.findViewById(R.id.PreferenceTitleTextView); titleView.setText(getTitle()); AutoCompleteTextView inputView = new AutoCompleteTextView(getContext()); inputView.setGravity(Gravity.FILL_HORIZONTAL); ArrayAdapter<CharSequence> adapter = new ArrayAdapter<CharSequence>(getContext(), R.layout.auto_complete_text_list_item, getEntries()); inputView.setAdapter(adapter); inputView.setThreshold(1); inputView.setOnItemSelectedListener(this); layout.addView(inputView); return layout; }

    Read the article

  • Hide ul when lost focus in JQuery..

    - by Ramesh Vel
    Hi, I am trying to hide the sub menu items(ul) when it lost focus.. my structure looks something like this <div id="ActionDiv" style="border-color: #0099d4; width: 120px; height: 100%"> <ul> <li><a href="#"><span id="ActionHeader">Action &nbsp; <em> <img src="images/zonebar-downarrow.png" alt="dropdown" /> </em></span></a> <ul> <li><a href="javascript:TriggerAction(1)">Send Email</a></li> <li><a href="javascript:TriggerAction(1)">Invite to chat</a></li> <li><a href="javascript:TriggerAction(1)">Consider For Opp</a></li> </ul> </li> </ul> </div> In JQuery i have used focusout event to handle the lost focus. $("#ActionDiv>ul>li>ul").focusout(function() { $("#ActionDiv>ul>li>ul").hide(); }); But the above code is not working. can anyone recommend a way to handle the lost focus event in the ul. Cheers

    Read the article

  • how is the container compoenet

    - by shay
    hello all i have an application with two main panel LEFT and RIGHT when a component got focus i want to know how is the container that holds that component (LEFT or RIGHT) the component can be inside some other panel's , but eventually sits inside the LEFT or RIGHT panel is there a more simple way to know who is the container without running in loop on get parent each time a component got focus thank you

    Read the article

  • Focusing on a form element in an iFrame

    - by Irwin
    how do I load a page in an iframe and set focus to a form element once the page loads? I don't have control over the page I am calling into the iframe, but I know the name of the form is 'form' and the text field I want to focus on is 'go'.

    Read the article

  • ASP page get current focused control

    - by Breander
    So what I have is a bunch of dynamically created textboxs that when the user enters some data and either tabs out or clicks out some calculations are done. After the page posts back control focus is lost. What I need is to be able to set focus back to the control that was tabbed to or clicked into not the control that data was entered into.

    Read the article

  • Ignoring focusLost(), SWT.Verify, or other SWT listeners in Java code.

    - by Zoot
    Outside of the actual SWT listener, is there any way to ignore a listener via code? For example, I have a java program that implements SWT Text Widgets, and the widgets have: SWT.Verify listeners to filter out unwanted text input. ModifyListeners to wait for the correct number of valid input characters and automatically set focus (using setFocus())to the next valid field, skipping the other text widgets in the tab order. focusLost(FocusEvent) FocusListeners that wait for the loss of focus from the text widget to perform additional input verification and execute an SQL query based on the user input. The issue I run into is clearing the text widgets. One of the widgets has the format "####-##" (Four Numbers, a hyphen, then two numbers) and I have implemented this listener, which is a modified version of SWT Snippet Snippet179. The initial text for this text widget is " - " to provide visual feedback to the user as to the expected format. Only numbers are acceptable input, and the program automatically skips past the hyphen at the appropriate point. /* * This listener was adapted from the "verify input in a template (YYYY/MM/DD)" SWT Code * Snippet (also known as Snippet179), from the Snippets page of the SWT Project. * SWT Code Snippets can be found at: * http://www.eclipse.org/swt/snippets/ */ textBox.addListener(SWT.Verify, new Listener() { boolean ignore; public void handleEvent(Event e) { if (ignore) return; e.doit = false; StringBuffer buffer = new StringBuffer(e.text); char[] chars = new char[buffer.length()]; buffer.getChars(0, chars.length, chars, 0); if (e.character == '\b') { for (int i = e.start; i < e.end; i++) { switch (i) { case 0: /* [x]xxx-xx */ case 1: /* x[x]xx-xx */ case 2: /* xx[x]x-xx */ case 3: /* xxx[x]-xx */ case 5: /* xxxx-[x]x */ case 6: /* xxxx-x[x] */ { buffer.append(' '); break; } case 4: /* xxxx[-]xx */ { buffer.append('-'); break; } default: return; } } textBox.setSelection(e.start, e.start + buffer.length()); ignore = true; textBox.insert(buffer.toString()); ignore = false; textBox.setSelection(e.start, e.start); return; } int start = e.start; if (start > 6) return; int index = 0; for (int i = 0; i < chars.length; i++) { if (start + index == 4) { if (chars[i] == '-') { index++; continue; } buffer.insert(index++, '-'); } if (chars[i] < '0' || '9' < chars[i]) return; index++; } String newText = buffer.toString(); int length = newText.length(); textBox.setSelection(e.start, e.start + length); ignore = true; textBox.insert(newText); ignore = false; /* * After a valid key press, verifying if the input is completed * and passing the cursor to the next text box. */ if (7 == textBox.getCaretPosition()) { /* * Attempting to change the text after receiving a known valid input that has no results (0000-00). */ if ("0000-00".equals(textBox.getText())) { // "0000-00" is the special "Erase Me" code for these text boxes. ignore = true; textBox.setText(" - "); ignore = false; } // Changing focus to a different textBox by using "setFocus()" method. differentTextBox.setFocus(); } } } ); As you can see, the only method I've figured out to clear this text widget from a different point in the code is by assigning "0000-00" textBox.setText("000000") and checking for that input in the listener. When that input is received, the listener changes the text back to " - " (four spaces, a hyphen, then two spaces). There is also a focusLost Listener that parses this text widget for spaces, then in order to avoid unnecessary SQL queries, it clears/resets all fields if the input is invalid (i.e contains spaces). // Adding focus listener to textBox to wait for loss of focus to perform SQL statement. textBox.addFocusListener(new FocusAdapter() { @Override public void focusLost(FocusEvent evt) { // Get the contents of otherTextBox and textBox. (otherTextBox must be <= textBox) String boxFour = otherTextBox.getText(); String boxFive = textBox.getText(); // If either text box has spaces in it, don't perform the search. if (boxFour.contains(" ") || boxFive.contains(" ")) { // Don't perform SQL statements. Debug statement. System.out.println("Tray Position input contains spaces. Ignoring."); //Make all previous results invisible, if any. labels.setVisible(false); differentTextBox.setText(""); labelResults.setVisible(false); } else { //... Perform SQL statement ... } } } ); OK. Often, I use SWT MessageBox widgets in this code to communicate to the user, or wish to change the text widgets back to an empty state after verifying the input. The problem is that messageboxes seem to create a focusLost event, and using the .setText(string) method is subject to SWT.Verify listeners that are present on the text widget. Any suggestions as to selectively ignoring these listeners in code, but keeping them present for all other user input? Thank you in advance for your assistance.

    Read the article

  • How can I use Window.ShowActivated = false with Maximized window?

    - by Anthony Brien
    I have an application that has a splash screen shown before I create my main window. I want to avoid the main window stealing the focus when it gets created if the user has focused another application while the splash screen was shown. My application's startup looks like this: private void Application_Startup(object sender, StartupEventArgs e) { SplashScreenService.Start(); // Initializing stuff... ... // Ready to open the main window. MainWindow mainWindow = MainWindow(); mainWindow.ShowActivated = SplashScreenService.HasFocus(); mainWindow.ShowDialog(); } To prevent the main window from getting activated, I'm setting Window.ShowActivated to false, only if the splash screen has lost the focus. But this causes an exception: InvalidOperationException: Cannot show Window when ShowActivated is false and WindowState is set to Maximized. Indeed, my MainWindow sets the WindowState to Maximized (restored from previous session settings). I don't understand why there is such a limitation with the ShowActivated feature. I couldn't find any documentation about this issue. I tried forcing WindowState to Normal when ShowActivated is false, and it prevents the exception, but it also activates the window! Maybe changing the window state actually causes an activation? Is there a trick I can use to work around this? I want to restore my main window in a maximized state, and not have the main window steal focus away from other applications if the user has focused away from my app during the splash screen.

    Read the article

  • Blackberry storm 9530 tracing touch events while scrolling

    - by SWATI
    hey in my screen there is a an edit field and 2 custom button fields as "OK" and "CANCEL" Below buttonfield there are some more focussable label fields when i write a name in edit field and press enter then focus comes to "OK" button but how to set focus on "CANCEL" button. Moreover while scrolling the focus does not automatically move ahead??? what to do may be i m confused with touch events and their handling!!! Kindly help!!!!!!!!!!!! Code: txt_Name = new EditField(TextField.NO_NEWLINE) { public void paint(net.rim.device.api.ui.Graphics g) { g.setColor(Color.MAROON); super.paint(g); } }; txt_Name.setFont(font); v1 = new VerticalFieldManager(); v1.add(txt_Name ); ButtonField btn1 = new ButtonField("OK",ButtonField.CONSUME_CLICK); ButtonField btn2 = new ButtonField("CANCEL",ButtonField.CONSUME_CLICK); v2 = new VerticalFieldManager(); v2.add(btn1); v2.add(btn2); LabelField l1 = new LabelField("Hello Moon ",Field.Focussable); LabelField l2 = new LabelField("Hello Citizen",Field.Focussable); LabelField l3 = new LabelField("Hello People",Field.Focussable); LabelField l4 = new LabelField("Hello world",Field.Focussable); v3 = new VerticalFieldManager(); v3.add(l1); v3.add(l2); v3.add(l3); v3.add(l4); add(v1); add(v2); add(v3); } protected boolean navigationClick(int status, int time) { if(OK.isFocus()) { //execute some code return true; } if(CANCEL.isFocus()) { //execute some code return true; } }

    Read the article

  • Android ListView with alternate color and on focus color

    - by Yogesh
    I need to set alternate color in list view rows but when i do that it removes/ disables the on focus default yellow background I tried with backgroundColor rowView.setBackgroundColor(SOME COLOR); also with backgrounddrwable. rowView.setBackgroundColor(R.drawable.view_odd_row_bg); <!-- Even though these two point to the same resource, have two states so the drawable will invalidate itself when coming out of pressed state. --> <item android:state_focused="true" android:state_enabled="false" android:state_pressed="true" android:drawable="@color/highlight" /> <item android:state_focused="true" android:state_enabled="false" android:drawable="@color/highlight" /> <item android:state_focused="true" android:state_pressed="true" android:drawable="@color/highlight" /> <item android:state_focused="false" android:state_pressed="true" android:drawable="@color/highlight" /> <item android:state_focused="true" android:drawable="@color/highlight" /> but it wont work. is there any way we can set background color and on focus color simultaneously which will work.

    Read the article

  • How to set focus to a textbox on page load event

    - by Kalpana
    I am trying to set focus to the text box on page load event. I tried many solutions by referring the element id, but couldn't able to focus the element. Later when I inspect the element using firebug I found for the same element the id changes in different execution. I am looking for the simplest solution using javascript or jquery to achieve this <h:form id="form"> <rich:dataTable value="#{books}" var="book"> <ui:repeat value="#{authors}" var="author"> <h:inputText value="#{author.name}"/> </ui:repeat> </rich:dataTable> </h:form>

    Read the article

  • netbeans editor loses focus on editor and gives it to the menubar

    - by aboutblank
    Hi all, I am newbie of using Netbeans and i have Netbeans 6.5 on XP. So, here is my problem: when i am working on Netbeans and switch to an another task and then come back later, editor of the Netbeans losts the focus and the menubar gains it. I don't want to press ALT key again to re-focus on the editor. I made some search on help contents of the Netbeans and google and i couldn't find any solution. Have any of you got an idea to solve this problem? By the way, i am sorry about my unfluent English. Have a nice day!

    Read the article

  • Keep focus on blur event

    - by Jim
    I am using jquery to keep the focus on a text box when you click on a specific div. It works well in Internet Explorer but not in Firefox. Any suggestions? var clickedDiv = false; $('input').blur(function() { if (clickedDiv) { $('input').focus(); } }); $('div').mousedown(function() { clickedDiv = true; }) .mouseup(function() { clickedDiv = false }); If you need anymore specifics let me know.

    Read the article

  • CHtmlView class and focus

    - by NativeByte
    I have an SDI application written in MFC. The frame is divided into 1 row and 2 columns using a splitter window. Below are details of Row and Column (R0C0 means Row#0 and Col#0) R0C0 view is a CFormView with multiple input controls like text box, combo box etc. R0C1 view is a CHtmlView that contains HTML content relavant to the control that has input focus in the R0C0 I am able to update the HTML content and also invoke Javascript functions through my MFC code. Problem: When user clicks on the R0C1, continaing CHtmlView, the focus is now on the html page. I wish to allow the user to tab out of R0C1 using the key board and return back to R0C0. Can you help with this please? The user can obviously click on the R0C0 view using mouse but we have a user who needs to use Keyboard for using this functionality. Let me know if the question is not descriptive enough and I'll simplify it further. Appreciate your time. Thanks, Byte

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >