For a WinForms control, I'd like to move certain settings into a sub object. One of them is a custom class containing all UI Strings, the other a OpenFileDialog:
class MyControl: Control
{
// ...
private OpenFileDialog m_dlgOpen = new OpenFileDialog();
public OpenFileDialog DialogOpen
{
get { return m_dlgOpen; }
}
}
Thi...
Question for you all, I've been charged with developing an application to view data about a testing cycle we do for environmental screening, products are placed in an environmental control, freezing and heating the product while a variety of self-tests are run. My manager would like to see a graph of temperature over time as an x/y graph...
If I have the following control:
public partial class MyControl : UserControl{
public string MyControlText{
get { return MyTextBox.Text; }
set { MyTextBox.Text = value; }
}
public MyControl(){ ... }
}
How can I bind to the "MyControlText" property when I place the control on one of my pages, like so:
<lo...
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>
</T...
I'm building a custom control in Silverlight by deriving from ContentControl and doing some special formatting to put a dropshadow behind the contents.
I've nearly got it working but have recently ran into a bizarre error. It works fine if it contains anything besides a Border, or a Grid/Stackpanel/etc that does not have an explicitl...
There is a program with a long list, from which I would like to take screen shots from. The Problem is, that there are only 14 of about 100 shown. How can I take a screen shot of the entire list?
The one approach that comes to my mind is basically send a PG-Down click to this list, take a new screen shot and merge them together. Are the...
This is partly in reference to this:
http://stackoverflow.com/questions/485390/why-isnt-the-selectedindexchanged-event-firing-from-a-dropdownlist-in-a-gridview/641715#641715
I thought it different enough to ask another question.
My thought is that instead of adding a dropdownlist (ddl) to a gridview and then using the technique above ...
I need a way to for a custom control (descended from TCustomControl) to tell if it is currently visible. I'm not talking about the .Visible property; I mean whether or not it's actually being displayed on-screen at the moment. Does anyone know how to do this?
...
I'm writing a custom control and I would like to include some configuration options for the control, but I'm not sure where I should put them.
I could probably put them in the the web.config of the application where I'm using the control, but that seems a bit messy to me.
What should I be doing?
EDIT:
The configuration data will typi...
I'm looking into creating custom controls for WPF and I've found some reasonably useful blogs and such that vaguely go into enough detail but I'm still struggling a bit.
Basically, what I'm trying to create is something akin to the infamous 'Coda Slider' but i just don't know enough to get started properly. Can anyone either point me i...
SOLUTION:
Thanks to Patrick below, I have refactored the C# CodeProject version into a VB.NET version that works for me. Hopefully it can help you guys as well:
Partial Public Class WatermarkedTextBox
Inherits TextBox
Private _waterMarkColor As Color = Color.LightGray
Public Property WaterMarkColor() As Color
Get
...
I'm creating a UserControl and I just can't remember the name of the attribute which you use to decorate the property which you want to act as the default content property.
To give a concrete example, say i have a property called 'Title' which i can set using property syntax like this -
<local:myControl Title="the title"/>
But the...
I know that it is possible to define custom tags in ASP.NET with User Controls. But as far as I know you can only add attributes to these controls. I would like to be able to embed more complex data, a bit lite this:
<myControls:MyGraph id="myGraph1" runat="server">
<colors>
<color>#abcdef</color>
<color>#123456</color>
...
I am attempting to create a reusable navigation style Custom Control in WPF, like a navigation bar on a website. It will contain links to all the main Pages in my app. This control can go on top of all my Pages in my NavigationWindow. Giving a nice consistent look and feel across pages, like a website.
My issue is in styling the curr...
Hello!
I have such task - to create control that union two controls (DataGrid from WPFToolkit and standard Toolbar). On a large scale, it doesn't matter what particular controls it unions, I need to find out the common practices that can be used to build what I need. At first glance, I need something like user control, i.e composition ...
The generated HTML code for my custom ASP.net server control generates the name attribute for child controls, instead of the id attribute. Something like this :
<span id="GridView2_ctl02_editdis">
<input type="text" name="GridView2$ctl02$editdis$ctl00"/>
</span>
The ID for the custom control itself is apparently proper.
What is e...
In visual studio when you create a custom control you get this ugly little purple gear thing for an icon of your control instead of a custom control .
So how can I change the icon for my control?
...
Hello,
In our IDE, for example, Visual Studio, if we display the properties of a System.Windows.Forms.Button control, we see some properties that expose anoter set of properties. For example: FlatAppearance, Font, Location, Margin, etcetera.
I would like to do something similar in a custom control.
I know the code behind is wrong, but...
I've written the following (very simple) control for use in an application (comments removed for brevity):
public partial class HorizontalRule : Control
{
public HorizontalRule()
{
InitializeComponent();
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
var g = e.Graphic...
I've got some custom templated controls which take JavaScript as template content, like so:
<ns:Custom runat="server">
<contentTemplate>
var a = new Array();
for (var i=0; i<a.length; i++) {
// do something
}
</contentTemplate>
</ns:Custom>
I want VisualStudio to treat the content of exactly the same as it does ...