w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How can I change the selected text background color in Rich text box wpf c#
private static TextPointer GetTextPointAt(TextPointer from, int pos) { TextPointer ret = from; int i = 0; while ((i < pos) && (ret != null)) { if ((ret.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.Text) || (ret.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.None)) i++; if (ret.GetPositionAtOffset(1, LogicalDirection.Forward) == null) return ret; ret = ret.GetPositionAtOffset(1, LogicalDirection.Forward); } return ret; } internal string Select(RichTextBox rtb, int offset, int length, Color color) { // Get text selection: TextSelection textRange = rtb.Selection; // Get text starting point: TextPointer start = rtb.Document.ContentStart; /

Categories : C#

Change text color and background color of textview using color picker in android
As is replied in this question: Android Color Picker there is an example of color picker. Using it you could change the color with: Color colorPicket = Color.parse("color returned of color picket"); TextView textView = (TextView) v; textView.setBackgroundColor(colorPicked); //if it returns in hex you can parse with COlor.par textView.setTextColor(colorPicked); Take a look: Color.parseColor

Categories : Android

Change listview row item background color and text color in android
Concerning the background, you should create a StateList Drawable and set it as the background of your rows. Ex of a such drawable (could be named background_selector.xml) : <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true" android:drawable="@color/color1" /> <!-- pressed --> <item android:drawable="@color/color2" /> <!-- default --> </selector> And in the layout declaration of your row : ... android:background="@drawable/background_selector" ... Use the same way for your text with the Color State List

Categories : Android

Change font color based on the background image dominating color(in the text area)
may be create a table on top of your image. This way you can control the area of your text with a contrasting color and you can change you font to whatever you like. The image in the background can stay to whatever you like and I am assuming the image is in the body of your page. Anyways,this is I could think of for you and I hope it helps. I know colors and images are always hard and time consuming to get them set up. <table border="0" bgcolor="#00FF00"> <tr> <th>day</th> <th>Saving</th> </tr> <tr> <td>January</td> <td>something</td> </tr> </table>

Categories : PHP

How do I change ONLY java modifier text color in Eclipse?
You can only change those which you find under Windows>Preferences>Java>Editor>Syntax Colouring Here modifiers are contained by group "Keywords excluding 'return'". There is no separate group for just modifiers.

Categories : Java

Jquery how to change text background to different color
You could use the code listed below to determine what triggered the function, and then lookup what color it has followed by changing it to the new color. idTrigger = event.target.id; Besides that you should also remove the other class, otherwise case one will always be the case. You can do so by using: $(this).removeClass('click'); Adding can be done by: $(this).addClass('click'); However, I am wondering why you are not just using the jQuery .val() function to store some data. http://api.jquery.com/val/

Categories : Javascript

Change both text and background color in title bar (Android)?
<style name="ThemeSelector" parent="android:Theme.Light"> <item name="android:windowTitleBackgroundStyle">@style/WindowTitleBackground</item> <item name="android:windowTitleStyle">@style/CustomWindowTitle</item> </style> <style name="WindowTitleBackground"> <item name="android:background">@color/titlebackgroundcolor</item> </style> <style name="CustomWindowTitle" parent="WindowTitle"> <item name="android:textAppearance">@style/CustomWindowTitleText</item> </style> <style name="CustomWindowTitleText" parent="android:TextAppearance"> <item name="android:textColor">@color/titletextcolor</item> </style> <style name="WindowTitle"> <item name="andr

Categories : Android

Input text in field change background color of div
I'd suggest using classes instead of changing CSS attributes. This should work $(function () { $('#inputDatabaseName').keypress(function () { var $this = $(this), $div = $(this).parent(); // Cache the jQuery selectors to make code faster if ($this.val().length > 0) { $div.addClass("hasContent"); } else { $div.removeClass("hasContent"); } }); }); Now add some CSS: #colorchange { background-color: white } /* default color */ #colorchange.hasContent { background-color: red } /* updated color */ #colorchange #inputDatabaseName { background-color: white } /* default color */ #colorchange.hasContent #inputDatabaseName { background-color: red } /*updated color*/

Categories : Javascript

Old javascript routine to change text and background color of cell
.childNodes was supported in chrome. .childNodes return an array. eg: document.childNodes return [<!DOCTYPE html>, <html>...</html>] document.childNodes[1] return <html>..</html> for(xx=0; xx < el.childNodes[x].childNodes.length; xx++) { if (el.childNodes[x].childNodes[xx].tagName=="A") { el.childNodes[x].childNodes[xx].style.color="FFFFFF"; } }

Categories : Javascript

Change background color of the row or range if a particular cell value is equal to some text
Based on Excel 2007: Ie in Conditional Formatting create three separate rules, each with a formula like =$A1="Approved" and formatting to suit and with Applies to: a sensible maximum for the range to be formatted.

Categories : Excel

change background color of window from data inputed from text field
I'm not familiar with titanium, but here's a couple of suggestions: function bgColour(colourData) { // do some transformations on the color data perhaps? // 1. We need to actually return the data: return colourData; } saveButton.addEventListener('click', function (e) { // 2. We need to get the value of the text field AFTER the saveButton // has been clicked, so this part of code is inside the event listener: var colourData = colourTextField.value; // 3. Mind the "style" and capital "C" in backgroundColor savedLocationsWindow.style.backgroundColor = bgColour(colourData); carLoggerTabGroup.setActiveTab(savedLocationsTab); });

Categories : Javascript

Customizing change Text and Background Color of row Item programmatically in Android
it doesn't work because the children of a listview are being re-used each time you scroll. you should either update the data and call notifyDataSetChanged , or update the data and use something like: int visiblePosition = mListView.getFirstVisiblePosition(); View view = mListView.getChildAt(position - visiblePosition); if(view!=null) { // update the view to have a different background and other stuff... } notes about the second way: on some adapterViews the second way might not work as expected. i'm not sure what will happen when changing the size of the view .

Categories : Android

android custom listview - change background and text color of selected item is not working?
After modifying the adapter we need to notify with notifyDatasetChanged() like if(selectedPosition == position){ ((TextView)convertView.findViewById(R.id.folderName)).setTextColor(Color.WHITE); ((LinearLayout)convertView.findViewById(R.id.folderLayout)).setBackgroundResource(R.drawable.folders_list_bg_s); notifyDatasetChanged(); }else{ ((TextView)convertView.findViewById(R.id.folderName)).setTextColor(Color.BLACK); ((LinearLayout)convertView.findViewById(R.id.folderLayout)).setBackgroundResource(R.drawable.folders_list_bg); }

Categories : Android

codemirror selected text css does not work (div background color doesn't show in text area)
By making every div in the page position: relative by default, you're going to cause unwanted side effects. In this case, it probably messed up the z-index ordering and thus prevented the divs used to draw the selection being on top of the background. Just do not use blanket rules like that if you want to be able to use widgets like CodeMirror on your page.

Categories : Javascript

CSS: How to make background color around text not flush to the text?
I tried playing your site and came up with this I hope this is what you want. Change your .advanced-sidebar-menu li > ul li a:hover { color: black; background-color: white; } to .advanced-sidebar-menu li > ul li:hover { color: black; background-color: white; }

Categories : CSS

How to display text background color beyond text?
I don't know if I fully understand your question, but maybe you could set a min-height property to your container, so that no matter how short the text is, it will always display a minimun height.

Categories : CSS

Hover over text and make text elsewhere change color
You need to use the general sibling selector (~). Otherwise it looks for the .donttext child of the hovered element. Browser support isn't great, but it'll work on anything the transitions work on (more or less). .youtext:hover ~ .donttext{ text-shadow: 0 0 0.3em #fff; color:#fff; -webkit-transition: all 0.4s linear; -moz-transition: all 0.4s linear; transition: all 0.4s linear; } demo

Categories : HTML

Change text color of existing text
If you are typing in the box an the colour is set to white, there is no need to run the code. You only need to run it when you add text that you haven't typed (eg copy/paste from your example). Therefore, use that code in the TextChanged event, but perform a check before running it as to whether the user has typed the text or added it another way EDIT: Check the answer to this question: Detecting a paste into a RichTextBox, it might help you

Categories : C#

How to customize backgroud, background color and text color for Toast in android
Toast has a setView() method. You can customize a Toast to show any view. I'd say instead of trying to edit the view inside the Toast, you just create a View and pop it in yourself.

Categories : Java

Automatically contrasting text color based on background image color
You could do something like this. (using Colours.js and this answer) Note, this will only work with images on the same domain and in browsers that support HTML5 canvas. Javascript function getAverageRGB(imgEl) { var blockSize = 5, // only visit every 5 pixels defaultRGB = { r: 0, g: 0, b: 0 }, // for non-supporting envs canvas = document.createElement('canvas'), context = canvas.getContext && canvas.getContext('2d'), data, width, height, i = -4, length, rgb = { r: 0, g: 0, b: 0 }, count = 0; if (!context) { return defaultRGB; } height = canvas.height = imgEl.naturalHeight || imgEl.offsetHeight || imgEl.h

Categories : Javascript

How can use transparent color in QColorDialog for clear background color of text?
If you use static QColorDialog::getColor function, pass QColorDialog::ShowAlphaChannel as the 4th argument. If you use QColorDialog object, use dialog.setOption(QColorDialog::ShowAlphaChannel).

Categories : Qt

Android - hidden text --> show text for 2 seconds --> hide text again
Try the following: Show "I'm thinking" Calculate your move but don't actually do the move, just store it for a while Schedule timer When timer runs out remove the text and do the move Something like this: onAndroidTurn(){ textView1.setVisibility(View.VISIBLE); saveMove(calculateNextMove()); new Handler().postDelayed(new Runnable(){ void run() { textView1.setVisibility(View.GONE); doNextMove(restoreMove()); } }, 2000); }

Categories : Java

LWJGL - Text's color changes background's color
First if all : The Color.white.bind() call in your drawText() function is probably what is affecting the background. Here is a quick and dirty example of how to only load the data once. I've moved data loading to the loadData() function. The DoomMain class is created once after the screen is opened, loadData() is called before the main loop and you call your drawing using menu.draw(). Ideally you would load all the resources you need in one place first, then pass the objects to DoomMain at initialization. You might want to use that texture and font in other places as well.. and you don't want to load it multiple times. public DoomMain() { // Open screen here since we need a context to make textures etc ... // Make objects for your different parts MainMenu menu = MainMenu

Categories : Java

If text is selected, and dropdown option is clicked, change color of selected text
The problem is when you click the select element it steals focus from textarea. You have to give back the focus to textarea element, here is a working example (at least in chrome): var color = document.getElementById("color"), // this is the select element content = document.getElementById("content"); color.onfocus = function (){ content.focus(); };

Categories : Javascript

css have a background color, text and an image in the same div
Do you mean this? .test { box-shadow: 3px 3px 5px darkGray; color: white; background: #e64e56 url(http://thumb10.shutterstock.com/thumb_small/536008/103572833/stock-photo-small-flower-isolated-on-white-background-103572833.jpg) no-repeat top right; } You can either define background-color, background-image, background-repeat and background-position separately, or use the shortcut background. When using the latter, it will overwrite the specific rules you have set, in this case background-color Here is the example, edited http://jsbin.com/axohoc/7/edit Here you can read up on the specifics of the shorthand property, as well as the different specific background properties: http://www.w3schools.com/css/css_background.asp

Categories : HTML

Background-aware text color
you can use text-shadow to mark the edge of your text. body { /* your rules */ color: rgba(0 , 0, 0, 0.8 ); /* just a guess that it might be black;*/ text-shadow: 0 0 1px gold, 0 0 3px white; /* choose how many and which colors */ } That is the idea

Categories : Jquery

TextView with background color only on the text itself
something like this should do the job String myString = "first line second long line"; Spannable spanna = new SpannableString(myString); spanna.setSpan(new BackgroundColorSpan(0xFFCCCCCC),0, myString.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); myTextView.setText(spanna); if you like to keep it in html you can use a WebView and load your html there, styling should be easier with css, I think

Categories : Android

How to set text background color using fabricjs
Try with .css() of property background-color like obj.css('background-color', 'rgb(0,200,0)'); Or you can give the color directly like obj.css('background-color', 'red');

Categories : Javascript

Background color on block of text on top of image
Use position:absolute to .add_rating and position:relative to parent div Your CSS is pretty long and that is not really required so compress it like this .pu { display:block; width:185px; position:relative } .add_rating { position:absolute; bottom:0; left:0; min-width: 140px; background: rgb(255,255,255); color: #f00; text-align: center; display: none; margin-top: -30px; margin-bottom: 12px; width: 100%; min-height: 22px; } .pu:hover .add_rating { display: block; } DEMO

Categories : HTML

css inset text background-color in firefox
I did a small example jsfiddle. The trick in creating such a shadow is by adding a text-shadow above and under the text (both are behind, but they're moved up or down). http://jsfiddle.net/mine/ru6pc/ It seems to work with Firefox, but you'll have problems with IE, I guess. IE < 10 doesn't support CSS-text-shadow yet, so you might take a look at pie-CSS (I don't know, if they're supporting it, but might be worth a look). .inset { font-family: Arial; font-weight: bold; font-size: 20pt; color: #4e830f; text-shadow: 0px -1px 2px rgba(0, 0, 0, 0.75), 0px 1px 2px rgba(255, 255, 255, 0.75); }

Categories : CSS

Text and background-color overlay on image
I made an example for you. http://jsfiddle.net/kb3Kf/2/ The main thing that was missing was that you gave the text an Absolute position but didn't give the wrapper a Relative one, like so: .img-overlay { position: relative; } It's really simple, you can take it to many directions. Tell me if that's what you wanted.

Categories : HTML

Transparent background affecting color of text
The opacity property affects all child elements of the element it's applied to. i.e. both the element itself and all elements it contains become opaque/transparent. What you need is to apply a rgba value to the div: #box { color:black; text-align:center; margin:50px auto; background: rgba(0,0,255,0.1); border-radius:11px; box-shadow:1px 1px 1px #656565; padding:20px; font-size:25px; }

Categories : HTML

how to add background color to input text if it is a dojo datepicker?
add !important to the end of your rules: <input type="text" ..other attributes.. style="width:5em !important;border:solid #FF0000 !important;"> This should apply stuff to the input. Please check if the element isn't replaced when dojo starts using it and if you are applying the style to the correct element.

Categories : CSS

How to color Linux terminal foreground and background text
You could use ANSI escape codes in your program output. And if you are coding the terminal emulator, you should make it understand those ANSI escape codes.

Categories : Linux

White border around text covers background color
Have you tried assigning a specific background-color on these elements? Try background-color : transparent; or background-color: #FFD700; on the child elements of #menu EDIT This is how the 'printed' pdf looks like for me: EDIT: Maybe it's a driver issue?

Categories : HTML

Removing background-color from all the text in the page, regardless whether we have a selection or not
You can replace your call to highlight from body to have an extra parameter prevRange which is a global one. and then reset prevRange to be undefined after the call. The signature of highlight can be function highlight(colour, oldRange) { and start like function highlight(colour, oldRange) { var range, sel, oldSelection; if (typeof(oldRange) !== 'undefined') { oldSelection = window.getSelection(); oldSelection.removeAllRanges(); oldSelection.addRange(oldRange); } sel = oldSelection || window.getSelection(); if (sel) { The rest of the function can work with sel. The old range will need to be stored in prevRange just before the deselection, and makeEditableAndHighlight can also get the optional parameter oldRange (and hav

Categories : Javascript

Error "UTF-8 Unicode C++ program text, with very long lines" and "ASCII English text, with very long lines"
These are not error messages in themselves, but output from the identification utility file. It's not good at recognizing different programming languages, and might think a C++ file is English or Java. "Very long lines" refers to the fact that the files have lines over 300 characters long. Both files are already UTF-8 (ASCII is a subset of UTF-8), and therefore don't need conversion (but you might prefer translating the line endings from to with dos2unix or tr -d ' '.

Categories : Linux

How to change format of long text in cell?
To force table cell contents to wrap, apply table-layout: fixed to the table and word-wrap: break-word to the td. Additionally, if you'd like the cells to have a fixed vertical height and scroll when they overflow, wrap your td contents in a div with overflow: auto and max-height: 100px. Here's the Fiddle: http://jsfiddle.net/9jwMZ/6/

Categories : HTML

change text color on change of selection in dropdown list for each row
You need a change in the Javascript for this to work. Working Solution Use this Javascript function updateTextColourrow1(value){ document.getElementsByClassName("style8")[0].style.color="#"+value; } function updateTextColourrow2(value){ document.getElementsByClassName("style8")[1].style.color="#"+value; } I have used two functions to access the two rows separately. This can also be done using only one function. Era800's method. JS function updateTextColour(sender) { var tempie = sender; //the dropdown list object //Find the table row of the dropdown list. while (tempie.parentNode.nodeName != 'TR') { tempie = tempie.parentNode; } //Get the selected color. var selectedColor = '#' + sender.value; //Set the row to the selected c

Categories : Javascript

How do i make the (.date) text background color a gradient (fade out)?
Something like this? jsFiddle .date { font-family: sans-serif; font-size: 14px; font-weight: 500; color: white; margin-top: 9px; opacity: 0.7; letter-spacing: 3px; text-transform: uppercase; background-color: #adadad; padding:10px; margin-left:-41px; margin-right:-41px; padding-left:30px; display : block; /* IE9 SVG, needs conditional override of 'filter' to 'none' */ background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIxMDAlIiB5

Categories : CSS



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.