custom-controls

Problem with drawing custom Windows controls

筅森魡賤 提交于 2019-12-04 13:31:51
I'm playing around with drawing my own custom controls using the uxTheme library in Windows, and I can't work out why my control doesn't look like the regular Windows control that (supposedly) uses the same theme I'm using: The above image shows a standard Windows ComboBox (top) and my custom control drawn using the ComboBox theme (bottom). What I can't work out is why the border from my control is a different shape and colour to the standard control. In my class constructor I open the theme data: mComboTheme = OpenThemeData( hwnd, L"COMBOBOX" ); And then in the handler for WM_PAINT I'm just

Custom Control for DataGridTemplateColumn

£可爱£侵袭症+ 提交于 2019-12-04 13:31:28
问题 I'm currently attempting to create a custom control out of a DataGridTemplateColumn that will be reused across many of our applications. I'm running into some issues getting a dependency property on the custom control to bind and raise the property changed notification correctly. I currently have the control inheriting from DataGridTemplateColumn the xaml looks like this: <DataGridTemplateColumn x:Class="Controls.DataGridDateColumn" xmlns="http://schemas.microsoft.com/winfx/2006/xaml

Propagate event from custom control to form

岁酱吖の 提交于 2019-12-04 13:16:48
I have a custom control like: public sealed class BorderEx : Control { public static readonly RoutedEvent ReloadClickEvent = EventManager.RegisterRoutedEvent("ReloadClick", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(BorderEx)); public event RoutedEventHandler ReloadClick { add { AddHandler(ReloadClickEvent, value); } remove { RemoveHandler(ReloadClickEvent, value); } } void RaiseReloadClickEvent() { var newEventArgs = new RoutedEventArgs(ReloadClickEvent); RaiseEvent(newEventArgs); } static BorderEx() { DefaultStyleKeyProperty.OverrideMetadata(typeof(BorderEx), new

Why shouldn't you use a handle during component creation or streaming?

时光总嘲笑我的痴心妄想 提交于 2019-12-04 10:50:32
I want to make a custom VCL control that wraps a SDL rendering surface via the SDL_CreateWindowFrom function. SDL_CreateWindowFrom takes an existing HWND handle and puts a high-performance rendering context (it has several backends available, including DirectX and OpenGL) onto it. The helpfile says "Do not refer to the Handle property during component creation or streaming." But it doesn't say why. It says that the first time you try to access the Handle property, it'll call HandleNeeded to ensure that a valid handle exists. So I have two questions. 1: What's the reason why you shouldn't

Custom textbox control [duplicate]

a 夏天 提交于 2019-12-04 10:03:16
This question already has an answer here: Watermark TextBox in WinForms 8 answers Is it possible to create a textbox in Visual Studio like this: You would just need to handle three TextBox events, in the Designer set the text of the TextBox to "username" and make it Font Italics then set TextBox BackColor to LightYellow,the rest is handled by Event handlers... private void textBox1_TextChanged(object sender, EventArgs e) { if (textBox1.Text == "") ChangeTextBoxtoWatermark(); } private void textBox1_MouseEnter(object sender, EventArgs e) { if (textBox1.Text == "username") { textBox1.Text = "";

Set predefined values to MultiAutoCompleteTextView : Android [closed]

假装没事ソ 提交于 2019-12-04 09:16:04
Closed. This question is off-topic. It is not currently accepting answers. Learn more . Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I have to set some predefined values to MultiAutoCompleteTextView (before I select from suggestion drop down list). It's like, as if you selected 2-3 items from drop-down list. After setting these predefined values, again I want to continue with normal process of filtering from the list and add it to MultiAutoCompleteTextView . It would look like this Predefined1, Predefined2, Predefined3, If I do

Is this indictment of DevExpress WPF controls valid and what is a good alternative vendor?

六眼飞鱼酱① 提交于 2019-12-04 09:00:27
问题 My company is starting a major greenfield development project using DevExpress WPF controls. I just read this critical review of their WPF controls: […] DevExpress developers completely misunderstood WPF when they developed their WPF controls. I really cannot impress upon you sufficiently well just how much of a displeasure it is using their controls. I feel absolutely terrible (almost guilty) about talking about a vendor with such negativity, but they have made a serious mistake in their WPF

Text diff visualization control for WinForms or WPF

情到浓时终转凉″ 提交于 2019-12-04 08:32:09
问题 In continuation of the my previous question, are the any good controls for text diffs visualization? Something like StackOverflow's revision diff viewer but for WinForms or WPF Requirements: free, preferably open-source based on WPF or WinForms No apps please, only components. I'm not interested in OSS diff tools 回答1: There is (as part of GitSharp) an open source diff engine in c# with a very easy to use API and (as part of GitSharp.Demo) a WPF diff viewer. The code should not be too

UIScrollView like Twitter app for iPad

送分小仙女□ 提交于 2019-12-04 07:48:50
问题 I'm looking for a tutorial or for some ideas to make a custom controller that looks like the one in the Twitter app for iPad, I mean the stacked pages with a main menu on the left. Thanks in advance for any help!! 回答1: we had created a mock project and added in github https://github.com/raweng/StackScrollView 回答2: I have a solution for this. Place a table view as a sidebar menu on the left side. Place a scroll view on the top. Add content into scroll view. The scroll view will cover the table

Android: Custom button OnClickListener is not getting invoked

半世苍凉 提交于 2019-12-04 07:19:04
I have a custom button, on which I am capturing its onTouchEvent. public class CustomNumber extends ToggleButton { boolean drawGlow = false; float glowX = 0; float glowY = 0; float radius = 30; public CustomNumber(Context context) { super(context); } public CustomNumber(Context context, AttributeSet attrs) { super(context, attrs); } public CustomNumber(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } Paint paint = new Paint(); { paint.setAntiAlias(true); paint.setColor(Color.WHITE); paint.setAlpha(70); }; @Override public void draw(Canvas canvas){ super