custom-controls

Show Transparent Loading Spinner above other Controls

喜夏-厌秋 提交于 2019-11-26 11:28:23
问题 I am working in a spinner control. I want the control to support transparent backcolor. When the arc is drawn, there is a blank space in the middle, I want that space to be truly transparent, so that I could put another control behind it and it would not be covered by the spinner. I tried overriding the CreateParams void. Also I set the style to support TransparentColor. Tried overriding OnPaintBackground void, but I cannot achieve the real transparent backcolor. So, what can you suggest me

Blackberry - how to resize image?

匆匆过客 提交于 2019-11-26 11:03:40
问题 I wanted to know if we can resize an image. Suppose if we want to draw an image of 200x200 actual size with a size of 100 x 100 size on our blackberry screen. Thanks 回答1: Just an alternative: BlackBerry - draw image on the screen BlackBerry - image 3D transform 回答2: You can do this pretty simply using the EncodedImage.scaleImage32() method. You'll need to provide it with the factors by which you want to scale the width and height (as a Fixed32). Here's some sample code which determines the

Binding to custom control inside DataTemplate for ItemsControl

狂风中的少年 提交于 2019-11-26 08:37:29
问题 I have a problem with bindings for DataTemplate based on defined DataType in ItemsControl , when I want to bind to my custom user control . For demonstration purposes, I\'ve created simple Item class example, where I have collection of items like this: public class Item { public string ItemNameToBeSureWhatPropertyIsBound { get; set; } } In my ViewModel I create such collection, and expose it (with one item for comparison separately): public class MainWindowViewModel : INotifyPropertyChanged {

Using Custom Colored Cursors in a C# Windows Application

做~自己de王妃 提交于 2019-11-26 08:34:56
问题 I am developing a SDG (Single Display Groupware) application, and for that I need multiple cursors (to the simplest of different colors) for the single window. I came to know that with C# you can just use black and white cursors, which does not solve my problem. So please help me with this problem. Thanks in advance. 回答1: The Cursor class is rather poorly done. For some mysterious reason it uses a legacy COM interface (IPicture), that interface doesn't support colored and animated cursors. It

TabControl with Close and Add Button

被刻印的时光 ゝ 提交于 2019-11-26 08:29:54
问题 I\'m tring to make a tab control have a \"x\" (close button) and \"+\" (new tab button). I found a solution to add a x button, the tab looks like this now: But I want to add a + where\'s that black circle right now. I have no idea how, I tried draw on Paint event of the last tab, like this: var p = tabs.TabPages[tabs.TabCount - 1]; p.Paint += new PaintEventHandler(tab_OnDrawPage); private void tab_OnDrawPage(object sender, PaintEventArgs e) { // e.ClipRectangle. e.Graphics.DrawString(\"+\",

Blackberry - fields layout animation

末鹿安然 提交于 2019-11-26 08:19:37
问题 It\'s easy to show some animation within one field - BitmapField or Screen: [Blackberry - background image/animation RIM OS 4.5.0][1] But what if you need to move fields , not just images? May be used: game workflow functionality, like chess, puzzle etc application user-defined layout, like in Google gadgets enhanced GUI animation effects So, I\'d like to exchange my expirience in this task, on the other hand, I\'d like to know about any others possibilities and suggestions. 回答1: This effect

Composing Swing Components: How do I add the ability to add ActionListeners?

一个人想着一个人 提交于 2019-11-26 05:56:53
问题 I want to create a (simple, hopefully) custom Swing component by composing several existing components. In my case, it is an on-off switch which consists of a JLabel, and two JButtons for On and Off. I begin OnOffSwitch by extending JPanel. The constructor adds the sub-components, and sets itself up as an ActionListener for the buttons. The class has an isOn() method for querying the current state of the component. I now want to add the ability to add ActionListeners to the OnOffSwitch class.

How can we do pagination in datagridview in winform

空扰寡人 提交于 2019-11-26 05:51:40
问题 I want to show 10 records per page in a datagridview on a window form and user must click next button to show next 10 records. Is it there some property in DataGridview or do i need to create a custom control. What i need to do to achieve this. 回答1: Here's a simple working example, where a BindingNavigator GUI control uses a BindingSource object to identify page breaks, by setting its DataSource to a custom subclass of IListSource. (Thanks to this answer for the key idea.) When the user

Android - custom UI with custom attributes

和自甴很熟 提交于 2019-11-26 05:17:28
问题 I know it is possible to create custom UI element (by way of View or specific UI element extension). But is it possible to define new properties or attributes to newly created UI elements (I mean not inherited, but brand new to define some specific behavior I am not able to handle with default propertis or attributes) e.g. element my custom element: <com.tryout.myCustomElement android:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\" android:text=\"Element...\" android

Blackberry User Interface Design - Customizable UI?

假如想象 提交于 2019-11-26 03:48:59
问题 I am trying to design a Blackberry Application and I am wondering if there are any resources on how to create custom user interface elements, skin existing ones and what other possibilities are there? I have developed a few iPhone applications with custom UI and stuff, so not sure what BB world offers in terms of UI development. Any tips, suggestions or ideas would be great. 回答1: There are no skins in Blackberry, two ways I know to achive skin effect are create own theme create custom