user-controls

jquery UI Modal Dialog in asp.net usercontrol: Modal Overlay only on Div in UserControl

懵懂的女人 提交于 2019-12-24 02:18:40
问题 I have an asp.net usercontrol that contains a jQuery UI Dialog Control. All works as expected execpt the grey tranparent overlay (to make the form modal) only appears on the hidden div below the form where the dialog is triggered from. Is it possible to target this overlay to the parent div? or is this not the right solution. I have tried the blockUI plugin (and removing the Dialog style to prevent its overlay showing), but although it "looks" right on screen it disables all the controls

Programmatically added User Control does not create its child controls

一个人想着一个人 提交于 2019-12-24 01:49:26
问题 I have a user control (.ascx) in my project that I am adding to a page programmatically in the page's Page_Load event handler, like so: Controls.Add(new MyProject.Controls.ControlWidget()); Databind(); When I try to access the control's child controls from within the control itself, they do not exist. public override void DataBind() { myrepeater.DataSource = GetDataSource(); // throws an exception because myrepeater is null base.DataBind(); } How do I access the user control's child controls?

applescript - control click

风流意气都作罢 提交于 2019-12-24 01:37:17
问题 How can I control click with AppleScript? This script should work, but it doesn't activate application "Finder" tell application "System Events" tell process "Finder" key down control delay 1 click at {600, 600} -- {from left, from top} delay 1 key up control end tell end tell MouseTools is sometimes unreliable. I know of cliclick — still haven't tried it. I'd prefer an AS only workaround but welcome any suggestions. 回答1: Most of the actions from contextual menu you can do using menu bar

How can I add InputScope property to PasswordBox in WinRT?

被刻印的时光 ゝ 提交于 2019-12-24 00:57:05
问题 How can I add Input Scope property to my User Control's PasswordBox? Could you explain it to me, please? Thanks. 回答1: according to the information i have PasswordBox does not have Input Scope Property in winrt so you can't set it directly. if you want do it you have to make your separate custom control. For defining your own Custom control you have read it on Windows Development Center ..or simply google it..hope it helps you.. you can use this link.. 来源: https://stackoverflow.com/questions

Changes in my userControl are erased when I rebuild in Visual Studio (designer view)

送分小仙女□ 提交于 2019-12-24 00:56:16
问题 This is my navigationItem.cs user control: using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Linq; using System.Text; using System.Windows.Forms; using Uboldi.Helpers; namespace Uboldi { public partial class NavigationItem : UserControl { public bool IsSelected { get; set; } private string _linkText = String.Empty; [Browsable(true)] public string LinkText { get { return this._linkText; } set { this._linkText =

Clear background of transparent user control

江枫思渺然 提交于 2019-12-24 00:52:40
问题 I'm working on ImageButton, in which I paint every state(i've got several images for each state) of this button (like mouseOver, mouseDown etc.). I've made control transparent using this code: public ImageButton() { InitializeComponent(); this.SetStyle(ControlStyles.Opaque, true); this.SetStyle(ControlStyles.OptimizedDoubleBuffer, false); } protected override CreateParams CreateParams { get { CreateParams parms = base.CreateParams; parms.ExStyle |= 0x20; return parms; } } But there's a

Asp.Net User Control does not work correctly when multiple are added to one form

不问归期 提交于 2019-12-24 00:24:13
问题 I have made a user control that allows an image to be uploaded and then cropped, but when I have several of these controls on one form, only the last one added will work correctly. The issue is the function storeCoords, has no effect on the X,Y, W and H hidden fields, thus when the crop 'rubber band' is moved, these values do not change. With the final control added, as the 'rubber band' is moved, the hidden fields are updated, and everything then works as expected. Why when I have several of

Make label participate in control tabbing

岁酱吖の 提交于 2019-12-23 22:40:07
问题 I have custom control that inherits from Label and has ControlStyle.Selectable set to true . The control receives focus when the user clicks on it, but won't if the user tabs from another control. Even when I have a form filled by only that type of controls none of them recieve focus by tabbing. How can I make my Label receive focus by tabbing? 回答1: It might be easier just to make it a TextBox, set the BorderStyle to None , set the BackColor to Control and set ReadOnly to True . This should

ASP.NET WebForms: Why do relative paths within user controls work locally, but not when deployed?

安稳与你 提交于 2019-12-23 22:22:42
问题 Rewriting Question I cannot, for the life of me, get relative image paths work consistently inside usercontrols between using VS's dev server and publishing to a remote IIS server. I do not want to make my image a server tag by adding runat="server" . I want it to be strictly client and I do not want to use any hocus pocus code hacks. I want to resolve the disconnect, so here is my problem: My images are stored in ~/images . My usercontrols are stored in ~/usercontrols/anothersubfolder . When

Should ViewModel inherit DependencyObject in WPF?

冷暖自知 提交于 2019-12-23 20:00:24
问题 I tried to create a simple UserControl in WPF using MVVM. Now I need to create a dependency property for the UserControl , so I tried to create the dependency property in UserControlViewModel (I don't want to be in code-behind). In order to create a dependency property in UserControlViewModel I need to inherit from DependencyObject . Is it a good practice to inherit DependencyObject in UserControlViewModel ? That is, is it a good way to follow MVVM for designing a UserControl ? 回答1: If you