styles

Create ItemTemplate for ListBox in code-beind in WPF

人盡茶涼 提交于 2019-12-13 14:51:16
问题 I'm trying to create an ItemTemplate for a ListBox programmatically but it doesn't work. I know in XAML I can have something like: <ListBox x:Name="listbox" BorderThickness="0" Margin="6" Height="400"> <ListBox.ItemTemplate> <DataTemplate> <TextBlock Margin="0" Background="Red" Foreground="White" FontSize="18" Text="{Binding}" /> </DataTemplate> </ListBox.ItemTemplate> </ListBox> But when I'm trying to have the above result programmatically I face a problem which is binding the TextBox

Android apply a theme on a custom item

混江龙づ霸主 提交于 2019-12-13 14:29:32
问题 i am able to declare a theme and a specific button design: <style name="MyTheme" parent="android:style/Theme.Black"> <item name="android:buttonStyle">@style/Button.b1</item> </style> <style name="Button.b1" parent="android:style/Widget.Button"> <item name="android:textColor">#000000</item> </style> The problem is that this style is applied to all buttons. I would like to declare a specific button with his own style changing each theme independent of the other buttons (something like a "save"

Textalignment is not working in java swing jTextPane

二次信任 提交于 2019-12-13 14:15:21
问题 I want to align two sections of texts on the same line: first section should be aligned to the left side, and the other section should be aligned to the right side of the java swing JTextPane. I tried to use style interface and Styleconstants class to align the text, but it didn't work. But when I applied some other styles, such as Styleconstants.setFontSize(), Styleconstants.setForeGroundColor() , on the same text, it's working fine. Here is my code: JTextPane pane = new JTextPane();

How can I have a textarea take up the remaining height in a div?

℡╲_俬逩灬. 提交于 2019-12-13 14:03:18
问题 I have a set of code as per below. The point is to have a set of images be in the div, and the remainder of the div is populated with a textarea. If I set the height = 100%, it will make it the same height, which isn't the (div.height - images.height) and makes the textarea longer. It says on w3c that inherit doesn't work at the moment, auto will just make a default textarea, and hardcoding it will never accomplish it as the div could be bigger or smaller. What have you all done to accomplish

How to add Search View on Action bar on one of the fragments in tab layout dynamically?

不想你离开。 提交于 2019-12-13 11:04:14
问题 Please provide me a better solution if you have I am working on android app in which on home Activity by using TabLaout&ViewPager i have added 5 tabs on below Home Social Notice Search Links I have set for MainActivity in values/style but i have placed custom action bar tag in search.xml. I know how to add SearchView on action bar in activity but i am facing issues using fragments. My goal is just to show search view widget on action bar when user will on "Search" tab. On other tabs i don't

style.css not loading in wordpress theme

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-13 10:25:09
问题 Here is my code that is not working in wordpress theme. using this code trying to getting style.css file from wp root folder. what's problem in this code is any thing not correct like function name <?php function add_style() { wp_enqueue_style('style', get_stylesheet_uri()); } add_action('wp_enqueue_scripts','add_style'); ?> But this code in wp function file is working correctly register_nav_menus(array( 'primary' => __('Primary Menu') )) ; So can any one help me ? 回答1: <link href="<?php

Find and add missing style attributes to an html string in C#

大兔子大兔子 提交于 2019-12-13 09:05:07
问题 I am stuck in a tricky situation, I have this string in C# with html tags : string strHTML = " <span style="font-size: 10px;">Hi This is just a section of html text.</span><span style="font-family: 'Verdana'; font-size: 10px;">Please help</span><span>me add style attributes to span tags.Thank You</span> "; As you can see, there are two span tags without "font-family: 'Verdana';". I need something that can help me add font-family to those two span tags so the desired result would be something

Extjs 5: how to make two panel with different style

时光总嘲笑我的痴心妄想 提交于 2019-12-13 08:13:47
问题 In a sencha app, I want to create two or more "Panel" in the same page, but with different Style. Panel_1.js: Ext.define("MyApp.view.Panel_1",{ extend:'Ext.panel.Panel', title:'Panel 1 title", //some try componentCls:'panel_1', cls:'panel_1' ... }); Panel_2.js: Ext.define("MyApp.view.Panel_2",{ extend:'Ext.panel.Panel', title:'Panel 2 title", componentCls:'panel_2' }); I add these two panels in one page, eg. the "center" of mainview. Add for css file with css class panel_1 and panel_2. But

How to display caret in custom WPF text box

我只是一个虾纸丫 提交于 2019-12-13 08:01:58
问题 I have designed my own text box in WPF by creating my own custom control template. However, I cannot seem to get the caret to show up. Here is my TextBox style: <Style TargetType="{x:Type TextBox}"> <Setter Property="SnapsToDevicePixels" Value="True"/> <Setter Property="OverridesDefaultStyle" Value="True"/> <Setter Property="KeyboardNavigation.TabNavigation" Value="None"/> <Setter Property="FocusVisualStyle" Value="{x:Null}"/> <Setter Property="AllowDrop" Value="True"/> <Setter Property=

Custom control default style

◇◆丶佛笑我妖孽 提交于 2019-12-13 07:28:24
问题 I like to separate some of my custom controls to a dll. lets assume I have the following example control: MyControl.cs namespace MyControlsNs { public class MyControl : ContentControl { public static DependencyProperty IsGreatProperty = DependencyProperty.Register("IsGreat", typeof (bool), typeof (MyControl), new PropertyMetadata(true)); public bool IsGreat { get { return (bool) GetValue(IsGreatProperty); } set { SetValue(IsGreatProperty, value); } } } } MyControl.xaml <ResourceDictionary