styles

How to hide a part of a WPF control

走远了吗. 提交于 2019-12-20 09:55:35
问题 Is it possible to hide a part of a WPF control? .NET 4 has a DatePicker which renders 4 parts, according to MSDN. Is it possible to hide (in my case) the TextBox part (probably named PART_TextBox)? I have seen examples of styling the DatePicker completely, and it involves alot of XAML, when all I want to do is hide one part of the control. 回答1: Well, I have a solution for your case :) class MyDateTimePicker : DatePicker { public override void OnApplyTemplate() { base.OnApplyTemplate(); var

How to change the default disabled EditText's style?

偶尔善良 提交于 2019-12-20 09:18:10
问题 It isn't looking nice when using EditText enabled="false". How can I change it automatically for all of the controls? I've added this image for reference. Can someone help me? Thanks. 回答1: In the color file define your color: <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_enabled="false" android:color="@color/disabled_color" /> <item android:color="@color/normal_color"/> </selector> In the layout: <EditText

How to get style from JtextPane?

别等时光非礼了梦想. 提交于 2019-12-20 07:18:30
问题 I have a JtextPane with formatted text. I need to copy the complete style and attributes from this text to transfer it to another JtextPane. Is there an example or code snippet to see how it works? ok, here is a code I found and I've changed a little bit: import java.awt.*; import javax.swing.*; import javax.swing.text.*; public class Main { private JTextPane textPane1; private JTextPane textPane2; private Document doc1; private Document doc2; private JFrame frame1; private JFrame frame2;

Change Iframe Style When the Src is Set Dynamically

╄→尐↘猪︶ㄣ 提交于 2019-12-20 07:05:29
问题 In my site I have this iframe <iframe id='iFrameName1' width='1000' height='500'></iframe> The src tag is dynamically defined with javascript. In addition, I want to dynamically change the style of the iframe (it is in the same domain). <script> function urlChange() { var iframe1 = document.getElementById('iFrameName1'); iframe1.src = 'mypage.html'; var cssLink = document.createElement("link"); cssLink.href = "iframe.css"; cssLink.rel = "stylesheet"; cssLink.type = "text/css"; iframe1

C# UWP ListView remove all visual effects

浪尽此生 提交于 2019-12-20 07:04:43
问题 In UWP I have a listview. XAML: <Grid Background="Gray"> <ListView Name="lvMain" VerticalAlignment="Top" HorizontalAlignment="Stretch" Height="120" ItemsSource="{x:Bind ItemsList, Mode=OneWay}"> <ListView.ItemsPanel> <ItemsPanelTemplate> <ItemsStackPanel Orientation="Horizontal"/> </ItemsPanelTemplate> </ListView.ItemsPanel> <ListView.ItemTemplate> <DataTemplate x:DataType="x:Int32"> <Grid Width="100" Height="100" Padding="10"> <Grid Background="Green"/> </Grid> </DataTemplate> </ListView

C# UWP ListView remove all visual effects

一个人想着一个人 提交于 2019-12-20 07:04:20
问题 In UWP I have a listview. XAML: <Grid Background="Gray"> <ListView Name="lvMain" VerticalAlignment="Top" HorizontalAlignment="Stretch" Height="120" ItemsSource="{x:Bind ItemsList, Mode=OneWay}"> <ListView.ItemsPanel> <ItemsPanelTemplate> <ItemsStackPanel Orientation="Horizontal"/> </ItemsPanelTemplate> </ListView.ItemsPanel> <ListView.ItemTemplate> <DataTemplate x:DataType="x:Int32"> <Grid Width="100" Height="100" Padding="10"> <Grid Background="Green"/> </Grid> </DataTemplate> </ListView

Call events or methods located in a Class from XAML

房东的猫 提交于 2019-12-20 05:19:06
问题 Hi i am trying if it's possible having an Event like TextChanged (of a TextBox) located in another place independent of the Window CodeBehind (like a Class). What i am trying to do is having in the ResourceDictionary a reference to an event of the TextBox. (Because the ResourcesDictionaries doesn't have a CodeBehind.) Note: It really have to be by this way, because i am customizing another control to have some TextBoxes dynamically and all the TextBoxes will fire the same event when

How to style uitableview to create pretty menu

徘徊边缘 提交于 2019-12-20 02:59:06
问题 I've been working on app, that has side-menu. I've been inspired by other apps, and I want my menu to look similar to theirs. Here are some examples (steam app menu, fb menu) Basically my question is, what kind of outlets are used in this menu? My first thought was, that those are tableviews with sections and static cells. However, even if they are tableviews, I've got no idea how to style my tableview that way. All I came up with, was this crappy design :D I would be very glad, if someone

How to inherit Button behaviour in WPF style?

穿精又带淫゛_ 提交于 2019-12-20 02:26:11
问题 I have overriden the WPF default Maximize, Minimize buttons like explained here. But, in my case, instead of using an Image to override background image for that buttons, I wanted to add my own template. So I created a ResourceDictionary that applies a style for Maximize/Minimize/Restore/Close buttons. The thing is that I override the template. As an example, see the PART_MINIMIZE button: <Button x:Name="PART_MINIMIZE" Width="30" Height="20" Margin="0,0,4,0" HorizontalAlignment="Center"

Good Style in Python Objects

心已入冬 提交于 2019-12-20 02:12:42
问题 Most of my programming prior to Python was in C++ or Matlab. I don't have a degree in CS (almost completed a PhD in physics), but have done some courses and a good amount of actual programming. Now, I'm taking an algorithms course on Coursera (excellent course, by the way, with a professor from Stanford). I decided to implement the homeworks in Python. However, sometimes I find myself wanting things the language does not so easily support. I'm very used to creating classes and objects for