Search Results

Search found 11 results on 1 pages for 'editcontrol'.

Page 1/1 | 1 

  • Accessing a dialog from Another dialog MFC

    - by Isuru
    Hi, I want to open a separate dialog box when I cllick on a button on my main dialog. I used separateDialog.DoModal() to do it. It open successfully but when I try to add data to a edit control (text box) in that seperate dialog, a debug assertion failure occurs. What is the matter and how can I overcome it? Thank You!!

    Read the article

  • Win32: edit control selection in dialog-based app

    - by Lars Kanto
    I have a dialog-based app with an edit-control in it. When I minimize / restore the app, everything's ok. But when I hide all the windows with holding down that Windows-logo-key and pressing "D" and then I restore the app, the edit-control selects everything inside it. How to make it not to select the text on restore?

    Read the article

  • [winapi] Three questions about editbox ?

    - by subSeven
    Hello! I have three questions about editbox control in WINAPI (i can't find information on msdn about this) 1. How to disable moving typeing cursor with mouse, arrows, backspace in editbox ? I want to make typing like in command line in dos, but with out backspace. Can I write some piece of text with red color, and another with blue ? How to write to editbox control from another thread ?

    Read the article

  • validation control unable to find its control to validate

    - by nat
    i have a repeater that is bound to a number of custom dataitems/types on the itemdatabound event for the repeater the code calls a renderedit function that depending on the custom datatype will render a custom control. it will also (if validation flag is set) render a validation control for the appropriate rendered edit control the edit control overrides the CreateChildControls() method for the custom control adding a number of literalControls thus protected override void CreateChildControls() { //other bits removed - but it is this 'hidden' control i am trying to validate this.Controls.Add(new LiteralControl(string.Format( "<input type=\"text\" name=\"{0}\" id=\"{0}\" value=\"{1}\" style=\"display:none;\" \">" , this.UniqueID , this.MediaId.ToString()) )); //some other bits removed } the validation control is rendered like this: where the passed in editcontrol is the control instance of which the above createchildcontrols is a method of.. public override Control RenderValidationControl(Control editControl) { Control ctrl = new PlaceHolder(); RequiredFieldValidator req = new RequiredFieldValidator(); req.ID = editControl.ClientID + "_validator"; req.ControlToValidate = editControl.UniqueID; req.Display = ValidatorDisplay.Dynamic; req.InitialValue = "0"; req.ErrorMessage = this.Caption + " cannot be blank"; ctrl.Controls.Add(req); return ctrl; } the problem is, altho the validation controls .ControlToValidate property is set to the uniqueid of the editcontrol. when i hit the page i get the following error: Unable to find control id 'FieldRepeater$ctl01$ctl00' referenced by the 'ControlToValidate' property of 'FieldRepeater_ctl01_ctl00_validator'. i have tried changing the literal in the createchildcontrols to a new TextBox(), and then set the id etc then, but i get a similar problem. can anyone enlighten me? is this because of the order the controls are rendered in? ie the validation control is written before the editcontrol? or... anyhow any help much appreciated thanks nat

    Read the article

  • Getting data from child controls loaded programmatically

    - by Farinha
    I've created 2 controls to manipulate a data object: 1 for viewing and another for editing. On one page I load the "view" User Control and pass data to it this way: ViewControl control = (ViewControl)LoadControl("ViewControl.ascx"); control.dataToView = dataObject; this.container.Controls.Add(control); That's all fine and inside the control I can grab that data and display it. Now I'm trying to follow a similar approach for editing. I have a different User Control for this (with some textboxes for editing) to which I pass the original data the same way I did for the view: EditControl control = (EditControl)LoadControl("EditControl.ascx"); control.dataToEdit = dataObject; this.container.Controls.Add(control); Which also works fine. The problem now is getting to this data. When the user clicks a button I need to fetch the data that was edited and do stuff with it. What's happening is that because the controls are being added programmatically, the data that the user changed doesn't seem to be accessible anywhere. Is there a solution for this? Or is this way of trying to keep things separated and possibly re-usable not possible? Thanks in advance.

    Read the article

  • ValidationProperty not returning entered value for textbox in custom ontrol

    - by nat
    hi I have a custom control, (relevant code at the bottom) it consists of some text/links and a hidden textbox (rather than a hidden input). when rendered, the user via another dialog and some JS sets the value of the textbox to an integer and clicks submit on the form. i am trying to assure that the user has entered a number (via the JS) and that the textbox is not still set to its default of "0" the requiredfieldvalidator works just fine, if i dont change the value it spots it on the client and fills the validation summary on the page with the appropriate message. unfortunately when i do fill the textbox, the validator also rejests the post as the controls textbox text value is still set to "0", even though on the form it has changed. clearly i am doing something wrong.. but cant work out what it is? could someone enlighten me please, this is driving me potty if i step through the code, when the get of the mediaidtext is hit,the findcontrol finds does not the textbox, if i inspect the controls collection however i can find the textbox, but its value is still "0" it also seems that when findcontrol is called, the createchildcontrols is called again - thus resetting the value back to "0" there.. ! how can i ever assure the control realises that the textbox value has changed? many thanks code below nat [ValidationProperty("MediaIdText")] public class MediaLibraryFileControl: CompositeControl { private int mediaId = 0; public int MediaId { get { return mediaId; } set { mediaId = value; } } public string MediaIdText { get { string txt = "0"; Control ctrl = this.FindControl(this.UniqueID+ "_hidden"); try { txt = ((TextBox)ctrl).Text; MediaId = Convert.ToInt32(txt); } catch { MediaId = 0; } return txt; } } protected override void CreateChildControls() { this.Controls.Add(new LiteralControl("<span>")); this.Controls.Add(new LiteralControl("<span id=\"" + TextControlName + "\">" + getMediaDetails() + "</span>")); TextBox tb = new TextBox(); tb.Text = this.MediaId.ToString(); tb.ID = this.UniqueID + "_hidden"; tb.CssClass = "hidden"; this.Controls.Add(tb); if (Select == true) { this.Controls.Add(new LiteralControl(string.Format("&nbsp;[<a href=\"javascript:{0}(this,'{1}','{2}')\" class=\"select\">{3}</a>]", dialog, this.UniqueID, this.categoryId, "select"))); this.Controls.Add(new LiteralControl(string.Format("&nbsp;[<a href=\"javascript:{0}(this,'{1}')\" class=\"select\">{2}</a>]", clearDialog, this.ID, "clear"))); } this.Controls.Add(new LiteralControl("</span>")); } protected virtual string getMediaDetails() { //... return String.Empty; } } this is the code adding the validationcontrol the editcontrol is the instance of the control above public override Control RenderValidationControl(Control editControl) { Control ctrl = new PlaceHolder(); RequiredFieldValidator req = new RequiredFieldValidator(); req.ID = editControl.ClientID + "_validator"; req.ControlToValidate = editControl.ID; req.Display = ValidatorDisplay.None; req.InitialValue = "0"; req.EnableClientScript = false; req.ErrorMessage = "control cannot be blank"; ctrl.Controls.Add(req); return ctrl; }

    Read the article

  • ValidationProperty not returning entered value for textbox

    - by nat
    hi I have a custom control, (relevant code at the bottom) it consists of some text/links and a hidden textbox (rather than a hidden input). when rendered, the user via another dialog and some JS sets the value of the textbox to an integer and clicks submit on the form. i am trying to assure that the user has entered a number (via the JS) and that the textbox is not still set to its default of "0" the requiredfieldvalidator works just fine, if i dont change the value it spots it on the client and fills the validation summary on the page with the appropriate message. unfortunately when i do fill the textbox, the validator also rejests the post as the controls textbox text value is still set to "0", even though on the form it has changed. clearly i am doing something wrong.. but cant work out what it is? could someone enlighten me please, this is driving me potty if i step through the code, when the get of the mediaidtext is hit,the findcontrol finds the textbox, but the value is still set to "0" many thanks code below nat [ValidationProperty("MediaIdText")] public class MediaLibraryFileControl: CompositeControl { private int mediaId = 0; public int MediaId { get { return mediaId; } set { mediaId = value; } } public string MediaIdText { get { string txt = "0"; Control ctrl = this.FindControl(this.UniqueID+ "_hidden"); try { txt = ((TextBox)ctrl).Text; MediaId = Convert.ToInt32(txt); } catch { MediaId = 0; } return txt; } } protected override void CreateChildControls() { this.Controls.Add(new LiteralControl("<span>")); this.Controls.Add(new LiteralControl("<span id=\"" + TextControlName + "\">" + getMediaDetails() + "</span>")); TextBox tb = new TextBox(); tb.Text = this.MediaId.ToString(); tb.ID = this.UniqueID + "_hidden"; tb.CssClass = "hidden"; this.Controls.Add(tb); if (Select == true) { this.Controls.Add(new LiteralControl(string.Format("&nbsp;[<a href=\"javascript:{0}(this,'{1}','{2}')\" class=\"select\">{3}</a>]", dialog, this.UniqueID, this.categoryId, "select"))); this.Controls.Add(new LiteralControl(string.Format("&nbsp;[<a href=\"javascript:{0}(this,'{1}')\" class=\"select\">{2}</a>]", clearDialog, this.ID, "clear"))); } this.Controls.Add(new LiteralControl("</span>")); } protected virtual string getMediaDetails() { //... return String.Empty; } } this is the code adding the validationcontrol the editcontrol is the instance of the control above public override Control RenderValidationControl(Control editControl) { Control ctrl = new PlaceHolder(); RequiredFieldValidator req = new RequiredFieldValidator(); req.ID = editControl.ClientID + "_validator"; req.ControlToValidate = editControl.ID; req.Display = ValidatorDisplay.None; req.InitialValue = "0"; req.EnableClientScript = false; req.ErrorMessage = "control cannot be blank"; ctrl.Controls.Add(req); return ctrl; }

    Read the article

  • How to structure my GUI agnostic project?

    - by Nezreli
    I have a project which loads from database a XML file which defines a form for some user. XML is transformed into a collection of objects whose classes derive from single parent. Something like Control - EditControl - TextBox Control - ContainterControl - Panel Those classes are responsible for creation of GUI controls for three different enviroments: WinForms, DevExpress XtraReports and WebForms. All three frameworks share mostly the same control tree and have a common single parent (Windows.Forms.Control, XrControl and WebControl). So, how to do it? Solution a) Control class has abstract methods Control CreateWinControl(); XrControl CreateXtraControl(); WebControl CreateWebControl(); This could work but the project has to reference all three frameworks and the classes are going to be fat with methods which would support all three implementations. Solution b) Each framework implementation is done in separate projects and have the exact class tree like the Core project. All three implementations are connected using a interface to the Core class. This seems clean but I'm having a hard time wrapping my head around it. Does anyone have a simpler solution or a suggestion how should I approach this task?

    Read the article

  • Update source with TemplateBinding

    - by Polaris
    I use this style for all my labels <Style TargetType="Label" x:Key="LabelStyle"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="Label"> <StackPanel Orientation="Horizontal" > <TextBox Loaded="MyTextBlock_Loaded" x:Name="EditControl" Visibility="Collapsed" Text="{TemplateBinding Tag}" /> <Label Content="{TemplateBinding Content}" Grid.Column="1" Grid.Row="1"> </Label> </StackPanel> </ControlTemplate> </Setter.Value> </Setter> </Style> and my sample label <Label Grid.Column="0" Grid.Row="0" Content="Photo" Style="{StaticResource LabelStyle}" Tag="{Binding fieldsCode.firstName, UpdateSourceTrigger=PropertyChanged}"/> But I feel that TemplateBiding doesn't support update of property. How can solve this issue

    Read the article

1