w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
Setting up a label custom control ?
you missed one line of code [self.view addSubview: label]; code should be write like UILabel* label = [[UILabel alloc] initWithFrame: labelFrame]; [label setText: @"My Label"]; [label setTextColor: [UIColor orangeColor]]; [self.view addSubview: label]

Categories : IOS

setting the recordsource of a subform control using VBA
Next I get a dialog box asking me to enter the parameter value for the 51 fields...I hit "enter" 51 times.... The SELECT clause lists 51 fields. If none of those fields exist in PLS_Elkins_072513, the db engine will assume the (unfound) field names are actually parameters and ask you to supply values for them ... 51 times. Then the subform fields can't find their Control Source in the form's recordset, so Access displays #Name? instead. Your VBA code includes ... Debug.Print strSQL So copy that output from the Immediate window, create a new query in the query designer, switch to SQL View, and paste in the copied text. That effort should help you figure out how you need to change the query so Access will accept it without asking for parameters. In a bigger picture view, as I under

Categories : SQL

Error setting Control Value within asp:ListView LayoutTemplate
allRatesLink is null because it is not being found which leads to the Object reference error when you try to set a property of null. You need the FindControl to be called after the LayoutTemplate is created such as in the OnLayoutCreated handler or after DataBind()

Categories : C#

Setting Focus to a Control after the Loading of the DataGrid
I hate to work in code behind but sometimes that is only way. This can be done in two ways according to me: Use EventAggregator to raise the event from your ViewModel once you are done with your filtering logic in it. Listen to this event in view code behind and in the handler do firstCombo.Focus() Second is bit dirty, So there must be the button or the last control after which you apply filter on your listview. In the buttonClickHandler/or any event of the last control (like selectionchange) directly do firstCombo.Focus(). In this case the moment you will press your button focus will move to combo. Thanks

Categories : Wpf

WPF Setting both DataTemplate and ControlTemplate on a control does not work
I reproduced your application. It seems the problem is in the TargetType property of the ControlTemplate: <ContentControl Content="{Binding}"> <ContentControl.Template> <ControlTemplate TargetType="ContentControl"> <Border BorderBrush="Blue" BorderThickness="2"> <ContentPresenter /> </Border> </ControlTemplate> </ContentControl.Template> </ContentControl>

Categories : Wpf

Setting child tag properties in a repeater control
Ok, I find the way to fix the problem. I used <%#Container.ItemIndex%> as id value of the div whose visibility property I'd like to change. Then send the <%#Container.ItemIndex%> as argument of the java functions Here is the code <asp:Repeater ID="RptComments" runat="server" > <ItemTemplate> <div id="DivComnt" class="Dcomment span9" onmouseover="MouseOver_Comment('<%#Container.ItemIndex%>')" onmouseout="MouseOut_Comment('<%#Container.ItemIndex%>')"> <div class="date" >Posted at <%#Eval("DateAdded")%></div> <br /> <p style="margin:2px 5px 2px 5px"><%# Eval("Comment") %> </p> <br /> <%--reply buttons--%&g

Categories : Javascript

Setting control properties in PreInit() vs Init()
Your Question 1: will there be some issue if we initialize the control properties in PreInit() instead of Init() In PreInit() event, controls are still not initialized completely, so it is not recommended to use this event to set Control properties. Question 2: for what purpose should we use the OnInit() event If question 1 is clear, then you agree that you will initialize Control properties in OnInit() as also is said by MSDN. Also, there is something important to understand about Init event and Control properties. In Init you cannot access any controls properties after the last viewstate. Suppose you enter some text in a textbox control and click on a button control that makes a postback, now you want to view the value latest entered. In such case you will be able to see the te

Categories : Asp Net

Programmatically setting access control limits in mosquitto
You could write a plugin to handle this for you. See http://mosquitto.org/2013/07/authentication-plugins/ for some examples. You may find more answers if you ask on the mosquitto mailing list.

Categories : Python

Setting the cookies to webbrowser control in windows phone
You can get the cookies with this: CookieCollection tempCookies = Microsoft.Phone.Controls.WebBrowserExtensions.GetCookies(this.BrowserControl); And set them with this: string CookieHeaders = "Cookies: SomeCookie=value1; SomeCookie2=value2; SomeCookie2=value2" this.BrowserControl.Navigate(new Uri(URL), new byte[0], CookieHeaders);

Categories : C#

Setting custom control properties from Style XAML
Change your FramesCount definition: public int FramesCount { get { return (string)GetValue(FramesCountProperty ); } set { SetValue(FramesCountProperty , value); if (ImageFileMask != null) ReloadFrames(); } }

Categories : C#

Setting Design Time Size for Custom Control
May b it helps u.......... for that firstly u have to make ur own controls by inheriting it with original controls and set Hieght,width and whatever you want in your custom control .........after this when u drag ur own made control form toolbox to ur form it will set by ur way whatever u wanted.......

Categories : C#

Setting default values for inherited properties on a custom control in WPF
Please take a look at the Control Authoring Overview page on MSDN for a complete answer to your question. However, in short, for a CustomControl, you should create a folder in your application root directory named Themes. You should add a XAML file named Generic.xaml into this folder and you should put a ControlTemplate for your CustomControl in there. For a UserControl, you can just add your Styles into the UserControl.Resources section of the page.

Categories : Wpf

Setting up CORS Access-Control-Allow-Origin on Rackspace Cloud Files?
That's not really what CORS is for. Cross-origin resource sharing (CORS) is a mechanism that allows Javascript on a web page to make XMLHttpRequests to another domain, not the domain the Javascript originated from, see CORS. It has nothing to do with making an object or container public/private. On Rackspace, CORS works according to this doc.

Categories : Apache

Amazon S3: Cache-Control and Expiry Date difference and setting trough REST API
"Amazon S3 Object Lifecycle Management" flushs some objects from your bucket based on a rule you can define. It's only about storage. What you want to do is set the Expires header of the HTTP request as you set the Cache-Control header. It works the same: you juste have to add this header to your PUT query. Expires doesn't work as Cache-Control: Expires gives a date. For instance: Sat, 31 Jan 2013 23:59:59 GMT You may read this: https://web.archive.org/web/20130531222309/http://www.newvem.com/how-to-add-caching-headers-to-your-objects-using-amazon-s3/

Categories : Rest

Setting private field on user control prevents changing 'Visible' from working
I finally found out why by looking at the actual response body. 156|error|500|Error serializing value 'withheld class name' of type 'withheld class name'| Why this error was not being thrown in debug is beyond me, but for anyone else reading this question looking for answers, look at your response bodies! It is because I was trying to put my instance of a class into Viewstate but that class was not marked with the Serializable attribute.

Categories : C#

Having trouble setting the width of the extlib dialog which is poped-up from inside a repeate control which inturn is within nested tabs (ie only)
In one of my applications I control the width of the dialog control by setting the following in CSS (in this example I set the width to 600px): .lotusDialogBorder, .lotusDialog, .dijitDialogPaneContent { min-width: 600px; }

Categories : Internet Explorer

how to add picture box control and label control dynamically in list view control
Did you google around? There are lot of links that can help you http://geekswithblogs.net/dotNETvinz/archive/2009/04/24/faq-displaying-image-from-database-to-gridview-control.aspx http://weblogs.asp.net/aghausman/archive/2009/05/26/show-images-on-grid-view-from-file-stream.aspx http://www.codeproject.com/Articles/20782/Displaying-Images-from-a-Database-in-a-GridView http://www.codeproject.com/Articles/20971/Thumbnail-Images-in-GridView-using-C

Categories : Asp Net

How to add an html control inside a div or crate a new control beside another control
var myA=document.createElement("a"); would create an element, you can set it's text by myA.innerHTML and src with myA.src="http://www.google.com" To add it to the page you can do: document.getElmentById("mydiv").appendChild(myA); to remove: var As=document.getElmentById("mydiv").getElementsByTagName("a"); var a = As[As.length-1]; a.parentElement.removeChild(a);

Categories : Javascript

Linux/Unix - Setting default file/folder permissions using ACL, executable permission not setting?
It's not setting the execute bit because files are only created with execute permission if the application explicitly requests it. Since it makes no sense to make an .html file executable, whatever program created it did not request execute permission to be added, so it has no execute permission. Consequently, execute permission from the default ACL effectively only applies to directories, not to files. As for why the default group is not set to ftp, this is more subtle. The default ACL is just that -- an ACL. It's not a default group ownership. As such it shows up not in ls but in getfacl: # mkdir public # setfacl -R -m u::rwx,g:ftp:rwx,d:g:ftp:rwx,o::rx public/ # getfacl public # file: public # owner: root # group: root user::rwx group::r-x group:ftp:rwx mask::rwx other::r-x defa

Categories : Linux

Setting value to a input field using Jquery val not working.I have commented out code setting value in edit() function
check this fiddle js fiddle here is the code that i have modified. function edit(id){ $("#firstName").val(data[id].firstName); $("#lastName").val(data[id].lastName); $("#city").val(data[id].city); $("#state").val(data[id].state); $("#pin").val(data[id].pin); }

Categories : Javascript

Rails form_for setting options and setting selected option
The parameters of f.select are: attribute_name,option_tags,options. option_tags is supposed to be a string of html option tags. There are some helpers to construct such a string from i.e. an array of values, a collection etc.: options_for_select, options_from_selection_for_select. You have to use one of these helpers. You can get the existing vehicle_sizees with: Model.pluck(:vehicle_size).uniq so your select could look like: <%= f.select :vehicle_size, options_for_select(Model.pluck(:vehicle_size).uniq,@model.vehicle_size) %> See the Rails Guide on form helpers.

Categories : Mysql

Setting css with jquery losing setting after page refresh
Use cookie for this $(function(){ var cookieval = $.cookie('cookie-key'); if (cookieval === 'something'){ //here restore style } });

Categories : CSS

What's the rule for preg_match() setting an empty string or not setting?
It depends on whether you make the whole capturing group optional or not. If you make the group required but allow it to match the empty string then the match will always be set, but might be empty: preg_match('/(d)(d?)/', '1', $matches); // $matches[2] === '' If you make the group optional by moving the quantifier ? outside the brackets, the match will be set conditionally: preg_match('/(d)(d)?/', '1', $matches); // no $matches[2]

Categories : PHP

How to show setting flyout by using button instead of setting charms
You can find the AppBar using Page.BottomAppBar and use FindName method to find a specific button and add a handler to that. The only point is you are currently creating your SettingFlyout inside an anonymous function, so only place you can do that would be inside your anonymous function.

Categories : C#

How can I use wildcards or regular expressions to control Path-based authorization / access control for svn?
as of June 2013 it is impossible to do this. So, the solution to the problem is to re-organize the repository so this isn't necessary. When a thing is too difficult it usually leads to a large rethink of the design or approach. At present maven structure leads to this requirement: root/pom.xml root/project1/pom.xml root/project2/pom.xml etc.. We can replace this with /root/pom.xml /project1/pom.xml /project2/pom.xml etc.. We can set the svn perms as follows granting all read access to the top level project and read write to their project. If an continuous integration build server populates an internal maven repo with the root snapshot then the users only need to checkout specific projects. [repo:/root] * = r @releng = rw [repo:/project1] @teamOne = rw [repo:/project2] @teamTwo =

Categories : Svn

how to restrict child control inside Parent control in Winform application?
if you add the label to the panel dynamically then you must do: this.panel1.Controls.Add(this.button1); if you don't, that the mistake. On top of that, when you move the label, make sure that the new values are inside the range of the panel, using panel1.Location.X panel1.Location.Y and share your code for more help if needed

Categories : C#

Update parent control when the child control is manually removed in the designer
To wrap it up, I found a solution to my problem. Like a TabControl, my ButtonList contains two collections: ControlCollection inherited from the Control class ButtonListItemCollection (TabControl has TabPageCollection) Adding ButtonListItems is done via the collection editor in the properties. Removing can be done either in the collection editor or just by selecting the ButtonListItem in the designer and pressing the DEL button on the keyboard (manual deletion). When using the collection editor, ButtonListItems are added/removed to/from the ButtonListItemCollection and then to/from the ControlCollection. However, when a ButtonListItem is manually deleted it is only deleted from the ControlCollection not from the ButtonListItemCollection. So what needs to be done is to detect when the

Categories : C#

Tap event on dynamically added custom control is handled by another control of same type
I figured out the problem, and I am chocking it up to lack of experience with WPF. When I made my Waypoints I created them like to var newWaypoint = new Waypoint(waypointNumber, latitude, longitude); newWaypoint.Name = "wayPoint" + waypointNumber; newWaypoint.Opacity = 100; double leftMargin = CalculateLeftMargin(longitude); double topMargin = CalculateTopMargin(latitude); newWaypoint.Margin = new Thickness(leftMargin, topMargin, 0, 0); LayoutRoot.Children.Add(newWaypoint); The problem with that was that I was setting the Margin of the control. When I set the Margin it was actually stretching out my Waypoint so I was having Waypoints on top of Waypoints. After some research I came across this article Changing Position of an Element Programmatically in WPF which showed me how to prope

Categories : C#

adding Control to form but gap keeps doubling when added at Bottom of previous control
this is more of a hack but it works. sharpUserX.Size = sharpUserSize PnlSharpUsers.Controls.Add(sharpUserX) sharpUserX.Location = pnlAddBtn.Location if i set the size before i add the control, then set the location after it seems to apply the font scaling to the size, but not the location, which works perfectly for me.

Categories : C#

jump to search result in a repeat control with a pager control in a xpages
A few pointers that might help you to go ahead: stop paging in repeats. The extlib has a nice sample of "show more", so instead of showing 1-20, 21-40 etc. you show until the record you found (might not work for large datasets) Open the search page with URL parameters that indicate the position number of the document (e.g. 498). Then use that parameter to let the repeat control figure out the starting position (which depends on the number of documents the repeat is configured for (default is 30, but you don't know). Just make sure not to use the passed parameter unchecked. you can add <a name="[unid]"> (or id=) tags to the repeat and then [directly navigate] (http://reference.sitepoint.com/html/a) to them ....nsf/searchResults.xsp#unid?moreParameters Let us know how it goes

Categories : Misc

Black lines when adding custom control to a panel with Control's DockStyle set to Top
Finally I found the solution to my problem. I was setting the Comment control's AutoSize property to true. When I set it false, it worked. Thanks @Sayse, your comment gave me hint about it.

Categories : C#

Border doesn't inherit Control, so how does a setter on Control.Background work?
Background dependency property in WPF is shared by many classes. It is defined in the Panel class, other classes just call AddOwner on it. Border.cs [CommonDependencyProperty] public static readonly DependencyProperty BackgroundProperty = Panel.BackgroundProperty.AddOwner( typeof (Border), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsRender | FrameworkPropertyMetadataOptions.SubPropertiesDoNotAffectRender)); Panel.cs [CommonDependencyProperty] public static readonly DependencyProperty BackgroundProperty = DependencyProperty.Register("Background", typeof(Brush), typeof(Panel), new FrameworkPropertyMetadata((Brush)null, FrameworkPropertyMetadataOptions.AffectsRender |

Categories : Wpf

Button sizes changing on user control when control is added to window
You have don't have your LastChildFill property set to False on your top DockPanel. This is the reason "Ent" is changing size and moving your screen. You also have the HorizontalAlignment on "Del" set to stretch. Try setting that to Left, but might be moot with the LastChildFill correction. The overall resizing is do to HorizontalAlignment set to Stretch set that to Left.

Categories : Wpf

ms-access 2007 form datetime control : if control length smaller than the size of the value it shows ###
Access doesn't behave like this. You can either increase the width of the control (the best solution) specify a shorter Format for the date reduce the font size An odd approach would be to add a label which obscures some of the date-control, but such that you can still see part of the date in the background. You might consider using an event such as Focus to change the Format of the control, but this won't work as the Format only applies when you move away from the control. You could, I suppose, use two controls; one for display and one for editing.

Categories : Forms

How to access the main page control values in user control
To retrieve, for example, a textbox defined in the aspx page from an ascx control contained in it you could try: Dim myTextBox As TextBox = Ctype(Me.Parent.FindControl("myTextBoxName"), TextBox) Note that the control you want to retrieve must have a runat="server" attribute otherwise it can not be seen server side. In your question you posted three controls without runat="server"; you could use instead: <asp:HiddenField ID="HiddenField1" runat="server" Value="1" /> <asp:HiddenField ID="HiddenField2" runat="server" Value="2" /> <asp:HiddenField ID="HiddenField3" runat="server" Value="3" /> In this case the above command would become: Dim myHiddenField As HiddenField = Ctype(Me.Parent.FindControl("myHiddenFieldName"), HiddenField)

Categories : Asp Net

I can not display binding value of a custom control's property when control loads
Try binding SelectedItem property to ControlTemplate <ScrollViewer x:Name="PART_ContentHost" Content={TemplateBinding SelectedItem} SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="Stretch"/>

Categories : Dotnet

Custom control events don't fire when control collection is cached?
The reason this doesn't work is because the controls must be recreated on the post back, and events wired up, for them to fire. See, since the server is stateless, to fire an event on an object, that object needs recreated AND readded to the form. How about cache the database result instead and continue the loop otherwise to build new, add, and hookup the controls?

Categories : C#

How to copy an ActiveX control over to another sheet preventing the name change of the control
ActiveX You can copy an ActiveX Control from one sheet to another with the below code. Note: you cannot have two objects of the same name on one spreadsheet. Sub CopyActiveX() Application.ScreenUpdating = False Dim x As OLEObject, y As OLEObject Set x = Sheets("SRC").OLEObjects("HasCustomName") Set y = x.Duplicate Dim xName As String xName = x.Name y.Cut With Sheets("TRGT") .Paste .OLEObjects(.OLEObjects.Count).Name = xName .Activate End With Application.ScreenUpdating = True End Sub Form Control To copy a button from one sheet to another preventing the automatic name change use the below code. Excel by default gives a new name to a copied button (even on a different sheet) so you have to rename it to match the name o

Categories : Vba

How to make binding from user control to property of parent control?
ElementName binding works within in same XAML scope. This will work - <Grid> <CheckBox Name="checkBox1"/> <Label Content="{Binding ElementName=checkBox1, Path=Name}"/> </Grid> But if you want to do it in different UserControl, you have to tweak a bit your code and use Tag to hold name - <Grid> <CheckBox Name="checkBox1"> <local:UserControl1 Tag="{Binding ElementName=checkBox1, Path=Name}"/> </CheckBox> </Grid> UserControl.xaml <Canvas> <Label Content="{Binding Path=Tag, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}"/> </Canvas> On a sidenote, in your UserControl, you know you need to bind with ElementName = checkBox1 and that's

Categories : Wpf

Access Parent Page Control in Child User Control
You will have something like this in tab control. <cc1:TabContainer ID="TabContainer1" runat="server"> <cc1:TabPanel ID="TabPanel1" runat="server"> <ContentTemplate> <asp:DropDownList id="dropdownlist1" runat="Server"/> </ContentTemplate> </cc1:TabPanel> So first you need to find tabPanel1 then find dropdownlist1 like following. TabContainer TabContainer1= (TabContainer)(this.Page.FindControl("TabContainer1"); if (TabContainer1!=null){ TabPanel TabPanel1= (TabPanel)(this.TabContainer1.FindControl("TabPanel1"); if(TabPanel1 !=null){ DropDownList dropdownlist1= (DropDownList)(this.TabPanel1.FindControl("dropdownlist1"); }}

Categories : C#



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.