control

Custom dropdown for CComboBox

I'm trying to create a custom dropdown for a derivative of CComboBox. The dropdown will be a calendar control plus some 'hotspots', e.g. So I figure the best way to achieve this is to have a simple CWnd-derived class which acts as the parent to the calendar control, and have it paint the hotspots itself. The window needs to be a pop...

creating a design in wpf using stackpanel and reusing it?

I want to create a design using Stackpanel in XAML pad in WPF and then embed images on it using .cx file. But I am getting some error using Styles. <Style x:Key="TopPanelDesign" TargetType="{x:Type StackPanel}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type StackPan...

How to access a named element in a control that inherits from a templated control

Hello this is similar to http://stackoverflow.com/questions/2620165/how-to-access-a-named-element-of-a-derived-user-control-in-silverlight with the difference is inheriting from a templated control, not a user control. I have a templated control called MyBaseControl Xaml:- <Style TargetType="Problemo:MyBaseControl"> <Setter Pr...

How to Clear an image control in WPF (C#)

I have an image control with a source image located in my c drive. I get a message that the image is being used by another process whenever I try to delete the original image to change it with another one dynamically. How do I release the image from the image control to be able to delete it. I tried this variants: string path = ((Bitma...

Windows Forms label custom control origin change.

I have a custom control derived from a label. I need to change the native control's location origin from upper left to lower left. Is there a method or property to do this? ...

How do you get an asp.net control's auto generated name attribute?

I have a DropDownList and need to know its name in the code behind: <select name="ctl00$cphMainContent$ddlTopic" onchange="javascript:setTimeout('__doPostBack(\'ctl00$cphMainContent$ddlTopic\',\'\')', 0)" id="ctl00_cphMainContent_ddlTopic"> <option value="All">All</option> </select> I need to get the value "ctl00$cphMainContent$ddlTop...

Session Variable Not Being Saved When Using Wizard Control ASP.NET

I have a wizard control. When someone clicks a button within the wizard control I automatically advance to the next step (rather than forcing them to click next). However, this seems to cause the session state variable not to be saved. I've done some research and noticed that Response.Redirect does hard redirects that truncate page execu...

ajax control toolkit watermark extender and update panel problem

I have a web page that initially loads a drop down list. When an item is selected from the list, a web form is dynamically created during an update panel async postback. I added watermark extenders to some of the textboxes, but the watermark does not display when the page is first updated. If I focus in and then out of one of the textbo...

TreeView Control unexpected event behavior

Hi all, In the MSDN is writen about TreeNode that: "By default, a node is in selection mode." "To put a node into selection mode, set the node's NavigateUrl property to an empty string." "When a node is in selection mode, use the SelectAction property to specify which event or events are raised when a node is selected." "Setting Tr...

Controlling Too Many listboxes ( C#)

I have almost 200 listboxes. I'm changing their visibility according to my variables from database. So I thought that, I prepared a arraylist. like this ListBox[] lbs = this.Controls.OfType<ListBox>().ToArray(); And used like this. for (int idx = 0; idx < Convert.ToInt32(ds.Tables[j].Rows[i][2])*12; idx++) lbs[idx].Visible = tr...

WPF add c# code to customcontrol

I want to create simple custom control (derived from control and with look defined in generics.xaml). I need to change size of elements defined in generic.xaml, when control is resized! It would be great to write some of that generic.xaml part in C#. Is that possible? Or is there a way to create MVVM like custom control? What i am willi...

Dispose Form opened in MainForm tab

Hi, I have a MainForm which has tab Control and several independent form. I open each Individual From in the tab of the main form. A "Close Tab" button on the MainFrom closes the current tab, its implementation is below. This closes the current tab but what I also need is to dispose the From whose tab is closed but I am not sure how to ...

Silverlight TabItem template not working correctly

Hello everybody! In a SL4 application i need to restyle my TabItems (actually add a button in the header). So i took the TabItem's control template from here and added the functionality i wanted. This seems to work fine, (i could dynamically add tabitems) with one exception: i think this posted control template is behaving somehow "...

When inheriting a control in Silverlight, how to find out if its template has been applied?

When inheriting a control in Silverlight, how do I find out if its template has already been applied? I.e., can I reliably get rid of my cumbersome _hasTemplateBeenApplied field? public class AwesomeControl : Control { private bool _hasTemplateBeenApplied = false; public override void OnApplyTemplate() { base.OnApp...

Custom Web Control - ParseChildren & Resource Objects

I hope someone can help me. I have the following custom server control: [ParseChildren(true)] public class MyControl : WebControl, INamingContainer { [PersistenceMode(PersistenceMode.InnerProperty)] public string MyProperty { get;set; } } It works perfectly with the following mark-up: <acme:MyControl runat="seve...

Jquery UI Tabs, control variable lenght spent on each tab?

I'm trying the following to control the speed of rotation of the tabs but with no luck, any ideas? $('#featured').tabs({ onShow: function(event, ui) { if(ui.index == 0)> { $('#featured').tabs("rotate", 2000, true); } else if(ui.index == 1){ $('#featured').tabs("rotate", 5000, true); } else if(ui.index =...

Can an iPhone/iPod Touch application open a port for remote communication without jailbreaking?

I'm researching remote control testing for an app that'll be installed on the new iPod Touch and can't tell for certain from everything that I've read whether or not an installed app can or can't open any ports for remote test instructions (that's a mouthful : ) We created something like this for the Android using adb port forwarding an...

Event is causing an error, but I can't catch the exception

A developer has created a custom control in ASP.NET using VB.NET. The custom control uses a repeater. In certain scenarios, the rpt_ItemDataBound event is encountering a data error. My goal is rather than having the user see the yellow screen of death, give the user a friendlier error explaining exactly what the data error is. I figu...

dynamically set the control template

hi, i am using dictionaries in WPF. i have two bitmap image in it with name something like image1 and image2 now in forms, i like to set them to single image control depending on condition, some times image1 and sometimes image2. so how i set the source dynamically, in dictonary i have UriSource="/wpf1;component/images...

CDateTimeCtrl - preventing 'focus' change when setting date

I'd like to use a CDateTimeCtrl to allow the user to select a non-weekend date. So, if the user increments the day (via a keypress) - and the resulting day is found to fall on a weekend - then the control should skip forward to the following Monday (don't let issues about month changes distract you, it's not relevant). Usually it's not ...