custom-controls

Custom control: How to override default properties?

我怕爱的太早我们不能终老 提交于 2019-12-11 08:53:23
问题 I've created a custom control similar to a button. I want to override his default properties, but it works strangely. UserControl Xaml <UserControl x:Class="project.MyButton" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable="d" d:DesignHeight="50" d:DesignWidth="50"> <Grid>

What is the best VB.NET control (standard/custom) for displaying list of files?

元气小坏坏 提交于 2019-12-11 08:45:04
问题 I'm developing a Desktop Search Engine in VB.NET and I'm looking for a powerful, flexible and feature-rich control for displaying the search results i.e. list of files. 回答1: If you are using WinForms, the standard is to use TreeView for folders a ListView for files/results. If you aren't in a hurry, rolling your own using WPF might be interesting. It would be much more flexible, but also a lot more work. 回答2: The System.Windows.Forms.ListView control is probably most similar to what Windows

How keep drop down opened in silverlights ComboBox?

一个人想着一个人 提交于 2019-12-11 08:35:04
问题 I use ComboBox control as popup. Item for my ComboBox is Grid. There is TreeView control and two Buttons in grid. Items of TreeView are CheckBoxes. When I click on Buttons or CheckBoxes drop down keeps opened, but when I click on other part of grid drop down i closed. Is there any way to keep it opened until I click outside of ComboBox? I have looked a lot in Google, but haven't found anything. <UserControl.Resources> <common:HierarchicalDataTemplate x:Key="HierarchicalDataTemplate

How to determine Windows Theme TColors

你离开我真会死。 提交于 2019-12-11 08:02:40
问题 I am emulating (to the degree possible) a TPopup Menu so it can float and users can drag it around. To do this, it's on its own form, and uses TPanels acting as if they are clickable TMenuItems. I'm using TPanels so I can change their color. To get the colors right, how can I determine at runtime (in Delphi 2010) the current theme's colors for TMenuItem.Color and TMenuItem.Font.Color (assuming such properties existed). TIA Edit I could use clBtnFace for the background, and clWindowText for

Custom Control Causing Null Reference Exception in Xamarin Forms Framework

我只是一个虾纸丫 提交于 2019-12-11 07:55:25
问题 I have built a custom SVG button so that I can have a Xamarin Forms button with text and an SVG image. I have had it working well and then I migrated my project to .NET Standard 2.0. Now, when changing the text on the control I get a Null Reference Exception inside the Xamarin Forms Framework's StackLayout's LayoutChildIntoBoundingRegion method on a ListDictionaryInternal. Here is the control. It is pretty simple. using System.Windows.Input; using FFImageLoading.Svg.Forms; using Core

Possible to have a inner control on a custom server control?

一世执手 提交于 2019-12-11 07:49:40
问题 I would like to be able to do something like: <ui:Tab Title="A nice title"> <TabTemplate> <asp:Literal runat="server" ID="SetMe">With Text or Something</asp:Literal> </TabTemplate> </ui:Tab> but also be able to do: <ui:Tab Title="A nice title"> <TabTemplate> <asp:DataList runat="server" ID="BindMe"></asp:DataList> </TabTemplate> </ui:Tab> Answer code I eventually came up with: [ParseChildren(true)] public class Node : SiteMapNodeBaseControl, INamingContainer { private ITemplate tabTemplate;

Issues with alignment with selection in a listbox

試著忘記壹切 提交于 2019-12-11 07:48:06
问题 I'm looking at creating a list of rectangles that specify their location by an x,y coordinate, however I'm seeing an issue with the alignment of the graphics. I'm using a list box with a custom layout panel. Here's the XAML for the main window: <Window x:Class="WpfFunkyPanel.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:WpfFunkyPanel" xmlns:system="clr-namespace:System;assembly

How to implement the same effect of marquees in winform?

旧时模样 提交于 2019-12-11 07:45:18
问题 I would like to make the text scrolling upwards or downloads. In html we can use Marquees "Cool Effects with Marquees!" , sample2 The c# WebBrowser control doesn't recognize the syntax of Marquees One way in c# is to use listbox, then rolling the listbox using timer. I am wondering if there is an easy way to do it. 回答1: If you want to draw animated text on a control, you need to create a custom control, having a timer, then move the text location in the timer and invalidate the control.

Xamarin - Button with text and image in absolute layout results in mis-aligned elements

这一生的挚爱 提交于 2019-12-11 07:19:39
问题 I am trying to create a button in a Xamarin Forms cross-platform app (iOS and Android), where the button has both text and an image. The XAML is pretty straightforward: <AbsoluteLayout ...> <Labels and backgrounds and such> <Button x:Name="HomeButton2" TranslationX="6" TranslationY="100" BackgroundColor="#efeff4" TextColor="#4a4a4a" WidthRequest="58" HeightRequest="76" ContentLayout="Top,5" Image="TaskBar_Assets_HomeButtonIcon.png" Text="Home" Clicked="HomeButton_Clicked" /> </AbsoluteLayout>