Search Results

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

Page 85/172 | < Previous Page | 81 82 83 84 85 86 87 88 89 90 91 92  | Next Page >

  • How to set Minimum and Maximum Character limitation to EditText in Android?

    - by nishitpatel
    I am new to android here i have very silly problem i want to set my Edit text box minimum and maximum input value. Here I am creating one Simple validation for Edit text it only take A-Z and 0-9 value with minimum 5 and Maximum 8 character. I set the Maximum and other validation as follow. <EditText android:id="@+id/edittextKode_Listing" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginRight="5dp" android:layout_marginLeft="5dp" android:layout_alignTop="@+id/textKode_listing" android:layout_toRightOf="@+id/textKode_listing" android:maxLength="8" android:inputType="textCapCharacters" android:digits="0,1,2,3,4,5,6,7,8,9,ABCDEFGHIJKLMNOPQRSTVUWXYZ" /> but not able to set Minimum requirement. My Edit text is in alert dialog and i also apply the following code to solve this problem ` private void openInboxDialog() { LayoutInflater inflater = this.getLayoutInflater(); // declare dialog view final View dialogView = inflater.inflate(R.layout.kirim_layout, null); final EditText edittextKode = (EditText) dialogView.findViewById(R.id.edittextKode_Listing); final EditText edittextalamat = (EditText) dialogView.findViewById(R.id.edittextAlamat); edittextKode.setOnFocusChangeListener(new OnFocusChangeListener() { @Override public void onFocusChange(View v, boolean hasFocus) { // TODO Auto-generated method stub if(edittextKode.getText().toString().length() > 0){ if(edittextKode.getText().toString().length() < 5) { edittextKode.setError("Error"); Toast.makeText(GPSActivity.this, "Kode listing value not be less than 5", Toast.LENGTH_SHORT).show(); edittextKode.requestFocus(); } } } }); final AlertDialog.Builder builder = new AlertDialog.Builder(GPSActivity.this); builder.setTitle("Kirim").setView(dialogView) .setNeutralButton("OK", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub gpsCoordinates = (TextView) findViewById(R.id.text_GPS_Coordinates); kode = edittextKode.getText().toString(); alamat = edittextalamat.getText().toString(); catatan = edittextcatatan.getText().toString(); pengirim = edittextPengirim.getText().toString(); if (kode.length() > 0 && alamat.length() > 0 && catatan.length() > 0 && pengirim.length() > 0) { message = "Kode listing : " + kode + "\nAlamat : " + alamat + " \nCatatan : " + catatan + " \n Pengirim : " + pengirim + "\nKoordinat GPS : " + gpsCoordinates.getText().toString(); sendByGmail(); } else { Toast.makeText( getApplicationContext(), "Please fill all three fields to send mail", Toast.LENGTH_LONG).show(); } } }); builder.create(); builder.show(); }` in this alert dialog i have two edittext i want to apply my validation on first edittext i called the setOnFocusChangeListener to check its minimum length on focus change and if length is less than 5 request for focus but it still type in second edittext. please help me out.

    Read the article

  • C# Read Byte [] to Image

    - by LucasGuitar
    I have an application which I'm adding pictures and these are automatically converted to binary and stored in a single file. how can I save several images, I keep in an XML file start and size of each set of refente to an image byte. But it has several images in bytes, whenever I try to select a different set of bytes just opening the same image. I would like your help to be able to fix this and open different images. Code //Add Image private void btAddImage_Click(object sender, RoutedEventArgs e) { OpenFileDialog op = new OpenFileDialog(); op.Title = "Selecione a Imagem"; op.Filter = "All supported graphics|*.jpg;*.jpeg;*.png|" + "JPEG (*.jpg;*.jpeg)|*.jpg;*.jpeg|" + "Portable Network Graphic (*.png)|*.png"; if (op.ShowDialog() == true) { imgPatch.Source = new BitmapImage(new Uri(op.FileName)); txtName.Focus(); } } //Convert Image private void btConvertImage_Click(object sender, RoutedEventArgs e) { if (String.IsNullOrEmpty(txtName.Text)) { txtName.Focus(); MessageBox.Show("Preencha o Nome", "Error"); } else { save(ConvertFileToByteArray(op.FileName), txtName.Text); } } //Image to Byte Array private static byte[] ConvertFileToByteArray(String FilePath) { return File.ReadAllBytes(FilePath); } //Save Binary File and XML File public void save(byte[] img, string nome) { FileStream f; long ini, fin = img.Length; if (!File.Exists("Escudos.bcf")) { f = new FileStream("Escudos.bcf", FileMode.Create); ini = 0; } else { f = new FileStream("Escudos.bcf", FileMode.Append); ini = f.Length + 1; bin = new TestBinarySegment(); } bin.LoadAddSave("Escudos.xml", "Brasileiro", nome, ini, fin); BinaryWriter b = new BinaryWriter(f); b.Write(img); b.Close(); f.Dispose(); } //Load Image from Byte private void btLoad_Click(object sender, RoutedEventArgs e) { getImageFromByte(); } //Byte to Image public void getImageFromByte(int start, int length) { using (FileStream fs = new FileStream("Escudos.bcf", FileMode.Open)) { byte[] iba = new byte[fs.Length+1]; fs.Read(iba, start, length); Image image = new Image(); image.Source = BitmapFrame.Create(fs, BitmapCreateOptions.None, BitmapCacheOption.OnLoad); imgPatch2.Source = image.Source; } }

    Read the article

  • Your favorite time-off between programming.

    - by Harsha
    I am sure all coding pundits here will have one (or multiple) ways of spending some time-off between hectic coding sessions just to relax. Would love to hear from you all as I am a newbie and want to take little breaks (non-physical) from coding and do things which actually help me focus again. Thanks.

    Read the article

  • Javascript UI Toolkit

    - by Louis
    I'm looking for a light-weight UI toolkit written in Javascript (something like Swing) but I'd rather not use ExtJS because I fear that will slow things down tremendously. Are there any small UI toolkits out there that mainly focus on layouts?

    Read the article

  • How to catch key press on a form c# .net

    - by flavour404
    Hi, I have a parent form that contains a lot of controls. What I am trying to do is filter all of the key presses for that form. The trouble is that if the focus is on one of the controls on the form then the parent form is not getting the key press event, so how do I capture the key down event? Thanks, R.

    Read the article

  • Where I can download

    - by Sorrybyenglish
    Where I can download source codes of sites on clear OOP without Frameworks or Cms? For best studying system of OPP and with perfect code where should I focus my coding style? I can learning only on examples of code whatever but i dont need script I need all site code entirely with Database data and with setting up Apache. Thanks everyone. Sorry by my English )) P.S can you advice to me what Projects with advantages? Exactly ;p

    Read the article

  • how to find out which textbox is currenlty selected.

    - by abcdefghijklmnopqrstuvwxyz
    I have 3 text-boxes, how do I find out which text-box is currently selected (has focus). I am unable to come up with anything. Public Class Form1 Public activeTextBox As TextBox = CType(Me.ActiveControl, TextBox) Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click activeTextBox.Text = activeTextBox.Text & "This is text 1" End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click activeTextBox.Text = activeTextBox.Text & "This is the text 2" End Sub End Class

    Read the article

  • How to embed a google map with a changeable area?

    - by Tom
    I haven't worded this very well But basically, I'd like to embed a map on my site - but the area it shows will change. I've tried doing this, but it never seems to work as it will focus on the wrong area - the old area, rather than the new area. Basically, I'd like a google map code that uses $place as a location. Thanks.

    Read the article

  • VBA Or .NET for working with Office?

    - by hosseinsinohe
    Hi All I want to develop and automate Office software like 'Microsoft Excel 2007' And 'Microsoft Word 2007'. But I do not know how to use VBA or use C#/.Net Framework to do so. What are the benefits of using VBA vs .Net framework? Which one should I focus on learning?

    Read the article

  • Recommendations for technical (programming) podcasts or audio books?

    - by David Pfeffer
    I'd like to do some professional development during my commute, but I find that reading programming texts on the bus and train cause nausia because of how much I have to focus on them. I'd like to find some good technical programming audio books, either free or for purchase/download and some good technical podcasts. What are the best programming audio books or podcasts out there, and where can they be found?

    Read the article

  • Weird jQuery UI Slider behavior using Page Up/Down

    - by qlassic
    I'm using jQuery UI's slider to update a div containing a number. Dragging or using the left/right keys should only allow the user to choose a number between 1 and 5 (this works as intended). However, if the handle has focus and I use page up/down, I start to get rounded values that are well out of the range of 1-5. Anybody experience the same? Thoughts?

    Read the article

  • What is the preferred syntax for initializing a dict?

    - by daotoad
    I'm putting in some effort to learn Python, and I am paying close attention to common coding standards. This may seem like a pointlessly nit-picky question, but I am trying to focus on best-practices as I learn, so I don't have to unlearn any 'bad' habits. I see two common methods for initializing a dict: a = { 'a': 'value', 'another': 'value', } b = dict( a='value', another='value', ) Which is considered to be "more pythonic"? Which do you use? Why?

    Read the article

  • Can I use anything other than BIGINT as Primary Key data type in SQLite?

    - by weenet
    I was psyched about the possibility of using SQLite as a database solution during development so that I could focus on writing the code first and dynamically generating the db at runtime using NHibernate's ShemaExport functionality. However, I'm running into a few issues, not the least of which is that it seems that SQLite requires me to use Int64 for my primary keys (vs, say, Int32 or Guid). Is there any way around this?

    Read the article

  • using JQuery to search a treeview

    - by hero
    i have a texbox and a treeview. i want the user to search in the treeview by typing in the textbox. i think the best way to do it is using JQuery. how can i search for a word inside a treeview , color it, and focus on it using JQuery? a simple example would be great...

    Read the article

  • Transparent textbox when textbox GotFocussed Windows Phone 8.1?

    - by user3701923
    I need to have transparent textbox, in my WindowsPhone 8.1 Runtime application. I made Background="Transparent" to the textbox, so it is transparent when it is loaded. But on focus, background color changed to white. I write the following code, to make it transparent. But it doesn't run.! <TextBox Background="Transparent" GotFocus="titleBox_GotFocus" /> C# private void titleBox_GotFocus(object sender, RoutedEventArgs e) { titleBox.Background = new SolidColorBrush(Colors.Transparent); }

    Read the article

  • JavaScript IF with AND/OR.. not working

    - by nobosh
    Can someone who is a master at JS tell me what's wrong with this? if ( $.trim($("#add-box-text").val()).length < 2 && $.trim($("#add-box-text").val()) != "Click here to add an item" ) { // If it's LT than 1 Character, don't submit $("#add-box-text").effect('highlight', {color: '#BDC1C7'}, 500); // Refocus $("#add-box-text").focus(); }

    Read the article

  • Extracting iPhone Exposure Setting

    - by dereck
    It seems that a similar question has been asked before, http://stackoverflow.com/questions/373357/obtaining-iphone-photo-exposure-information I wondering with the new iPhone camera, if there is any way to extract exposure data from the camera? it seems that it is able to sample different exposures based on where you focus, but I have yet to find any further documentation. Thanks

    Read the article

  • Printf example in bash does not create a newline

    - by WolfHumble
    Working with printf in a bash script, adding no spaces after "\n" does not create a newline, whereas adding a space creates a newline, e. g.: No space after "\n" NewLine=`printf "\n"` echo -e "Firstline${NewLine}Lastline" Result: FirstlineLastline Space after "\n " NewLine=`printf "\n "` echo -e "Firstline${NewLine}Lastline" Result: Firstline Lastline Question: Why doesn't 1. create the following result: Firstline Lastline I know that this specific issue could have been worked around using other techniques, but I want to focus on why 1. does not work.

    Read the article

  • how to change two div-positions on click with javascript

    - by flp
    hi folks, i got a webpage with some "cards" (divs) layin on it. they are positioned in a star-like order, flowing to the background. i want to bring cards from the background to the middle-foreground bei clicking on it (to focus the card "contact" for instance). how can i realize this? is there any script which is already containing a function like this?

    Read the article

< Previous Page | 81 82 83 84 85 86 87 88 89 90 91 92  | Next Page >