w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
Adding custom controls to IB xcode
The docs for CocoaTouch classes will usually indicate if a class is not designed for sub-classing. In the case of UISlider, there's also some instructions for customizing appearance. Custom Component in Interface Builder To use a custom component within Interface Builder, its necessary to use the "object" component, and specify the class type to your custom class. Unfortunately this does not render any visual queues, like core UIKit classes. Your own Plugin It may be possible to provide a plugin to tweak Xcode, however this is no small undertaking as there are no official docs, so its necessary to search for open-source plugins on GitHub, etc and study the code. Even then, the plugin may break with subsequent version of Xcode. Recommended Approach Interface Builder is an amazing t

Categories : Objective C

Adding custom server controls into MVC
You cannot use your ascx or dll custom controls in MVC. Mostly, because the lifetime of ASP.net controls is different. In MVC - controls just render HTML, They don't receive any postback, they don't save controlstate or viewstate. Even "Page" object does not exist in MVC. MVC controls can accept parameters and render HTML.

Categories : Asp Net Mvc

Adding controls to custom panels in the designer
For anyone that wants to know how to do this I was searching for the wrong thing as to why I couldn't find anything on the topic How to drop controls onto a panel in a user control?

Categories : Dotnet

jQuery selectable options slider
Choose any of carousel library from the web (I have used Bootstrap carousel before). Add an event listener to each button such that clicking each button makes the carousel show a specific page you want.

Categories : Jquery

JQuery code to change selectable dropdown options based on radio button selection
Your question is a little unclear, but from your code, I'm guessing you want to select specific values of the dropdowns after a radio button is selected. jQuery .val() is what you want. function myfunc(ele) { var $tr = $(ele).parent().parent(); var os = $tr.find("td:eq(1)").html(); var browsers = $tr.find("td:eq(2)").html(); var version = $tr.find("td:eq(3)").html(); var testscriptlist = $tr.find("td:eq(4)").html(); var server = $tr.find("td:eq(5)").html(); $("#OS").val(os); $("#browsers").val(browsers); $("#version").val(version); $("#testscriptlist").val(version); $("#server").val(server); }

Categories : Javascript

using custom controls instead of user controls to create complex views
Unless you need the functionality provided by custom controls, I would suggest using UserControls or DataTemplates. They are simpler. Here's a related questionanswer. WPF User Controls vs Custom Controls

Categories : Wpf

make Custom QWidget selectable
You could try to make a QMouseEvent implementation where the widget ID is forwarded, something like this: In the implementation of your widget (e.g. YourWidget.cpp): YourWidget::MouseReleaseEvent(QMouseEvent *event) { emit clickedWithMouse(this); // this is a signal, declared in YourWidget.h } In the "main" game file (e.g. Game.cpp): Game::onButtonClicked(YourWidget* widget) // this is a public slot, you must connect all YourWidgets's clickedWithMouse signals to this slot (in Game object code, e.g. when initialising the board) { lastWidget = widget; //save the widget "ID" (lastWidget is a member of class Game) someFunction(widget); //do something with the widget (if you wish) }

Categories : Qt

jquery ui selectable cancel selectable for blocked elements
You need to set the cancel selector as mentioned in the API: $("#selectable").selectable({ cancel: ".blocked" }); Link to the API Doc: http://api.jqueryui.com/selectable/ See this JSFiddle: http://jsfiddle.net/Sd8VJ/

Categories : Jquery

Custom Selectable Checkboxes To Display Results In Text Box
<form action="test2.php" method="POST"> <input type="checkbox" name="formDoor[]" value="#Example1" />1<br> <input type="checkbox" name="formDoor[]" value="#Example2" />2<br> <input type="checkbox" name="formDoor[]" value="#Example3" />3<br> <input type="checkbox" name="formDoor[]" value="#Example4" />4<br> <input type="checkbox" name="formDoor[]" value="#Example5" />5<br> <input type="submit" name="formSubmit" value="Submit" /> </form> Remove the commas from your values and do this in PHP. $val = implode(",",$_POST["formDoor"]); echo $val;

Categories : PHP

Custom Filter and LimitTo options with Custom ng-repeat directive
Yes, you can use filters inside your linking function: myApp.directive('myRepeater', function(filterFilter, limitToFilter) { return { restrict: 'A', link: function(scope, element, attrs) { var myTemplate = "<div>{{rating}}</div>"; var filteredItems = filterFilter(scope.items, scope.SearchText); var limitedItems = limitToFilter(filteredItems, 5); angular.forEach(limitedItems, function(item){ var text = myTemplate.replace("{{rating}}",item.rating); element.append(text); }); } }; }); Then, you would continue from there by creating $watchers to observe the changes on scope.SearchText and scope.NumberOfItems to update the list accordingly.

Categories : Javascript

Adding Dynamic Controls in ASP.NET
You need to have the logic in your click handler add to the panel's Controls collection as well as to the list of controls, like this: protected void btnAddAddress_Click(object sender, EventArgs e) { AddressUserControl aCntrl = LoadControl("~/UserControls/AddressUserControl.ascx") as AddressUserControl; addresses.Add(aCntrl); phAddresses.Controls.Add(aCntrl); } UPDATE: In your user control, you need to define an event that can be defined in the page that hosts the user control, like this: AddressUserControl.cs (code-behind): public event EventHandler RemoveAddress; protected void removeAddressUserControlButton_Click(object sender, EventArgs e) { // Find out if the event has been set, if so then call it if (this.RemoveAddress!= null) { RemoveAddress(se

Categories : C#

Adding NAudio controls to toolbox
Those are Windows Forms controls, not WPF controls. NAudio does include a WPF demo application which contains some bits you could reuse, and also the .NET Voice Recorder application shows how to display waveforms and volume meters in WPF while using NAudio.

Categories : Wpf

dynamically adding controls under loop in C#
You need to put the line private Label newLabel = new Label(); in the for loop. private int txtBoxStartPosition = 100; private int txtBoxStartPositionV = 25; for (int i = 0; i < 7; i++) { Label newLabel = new Label(); newLabel.Location = new System.Drawing.Point(txtBoxStartPosition, txtBoxStartPositionV); newLabel.Size = new System.Drawing.Size(70, 40); newLabel.Text = i.ToString(); panel1.Controls.Add(newLabel); txtBoxStartPositionV += 30; }

Categories : C#

How to improve speed of adding controls to UI
If your computer have multiple cores, and I am assuming it have, try to perform the for loop in parallel (parallelfor (from .net 4 or above). You can set the points List size during creation to 256, this will prevent memory allocations during the items adding operation. Consider use a StringBuilder if Global.currentZonesToMap is large. Use StringBuilder to build the value for the DevicePoint.desc string property. Good luck, M. Moshe

Categories : C#

Is there a quick way of adding an event to many controls at once in WPF?
Look into event routing. You should not create and access individual text-boxes but let the framework create them via datatemplating a collection, your above code is ze horror.

Categories : C#

Adding controls at runtime in from derived class in MFC
Declare a member variable CButton m_ctrl_chk, override DialodDervied::OnCreate() and add code like int DialodDervied::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CDialogEx::OnCreate(lpCreateStruct) == -1) return -1; m_ctrl_chk.Create(_T("Checkmate"), WS_CHILD | WS_VISIBLE | WS_TABSTOP | BS_AUTOCHECKBOX, CRect(5, 5, 100, 20), this, 1234); // the 1234 value is the ID of the control return 0; } Use similar classes (CEdit, CStatic, CButton, ...) to create other type of controls in the same way.

Categories : C++

Adding asp controls to programmatically added content
Its kinda hard to tell what your going for, but I will do my best to get as close as I can. The first thing is you need some control to work as a "container". This can be just about any control you like. In my test for this scenario I did something like this: <div runat="server" id="ContainerDiv"></div> The next thing is you need a way to manage your Id. I did this by creating a simple variable and method like so: private int IdCount = 0; private string GetNewID() { return string.Format("try{0}", IdCount++); } Now you say you want an achor tag that also has a CommandName and CommandArgument a LinkButton will do this. You can add a LinkButton to your div above like this: ContainerDiv.Controls.Add( new LinkButton() { ID = GetNewID(), CommandName

Categories : C#

Adding controls dynamically according to data type WPF
Get the list of PropertyInfos of your model and wrap them in ViewModels. Then use DataTemplates with implicit keys to generate your controls. Step1: Get PropertyInfoViewModels var vms = model.GetType().GetAllProperties.Select(p=> ViewModelFactory.Create(p)); Your factory should return a StringPropertyViewModel for string properties, etc. abstract class PropertyViewModel<T> : INotifyPropertyChanged { public string Caption {get; set;} public T Value {get; set;} } Step2: DataTemplates <DataTemplate TargetType="{x:Type sys:StringPropertyViewModel}"> <StackPanel Orientation="Horizontal"> <Label Text="{Binding Caption}" /> <TextBox Text="{Binding Value}" /> </StackPanel> </DataTemplate> Step3: Ensure the DataTemplates ar

Categories : Wpf

How optimal the code can be with dynamically adding the controls
Optimal code: Doesn't contain more than 50 lines of difficult to read code (agreed, it's not unreadable, but still, minor refactoring would help), Doesn't mix CSS with HTML, together with presentation-related HTML attributes such as width, Doesn't use the JavaScript alert. Let's get back to your question. Which one is better: StringBuilder or HtmlGenericControl? Better being an extremely vague term, let's answer a bunch of slightly different questions: Which one is faster ? Probably StringBuilder, given that it doesn't matter. At all. Compared to the time spent downloading an image (say two seconds, i.e. 2 000 ms.), the comparison in performance between StringBuilder and HtmlGenericControl will be very probably less than a millisecond. Is it important that you waste 1 ms. on a proc

Categories : C#

Adding Controls to a StackPanel from a BackroundWorker thread
Try using BeginInvoke instead. for (int i = 1; i <= 10; i++) { string content = DataSupplier.GenerateRandomInt(); this.Dispatcher.BeginInvoke((Action)(() => { lbl.Content = content; //create a new label, and set it's content to a randomly generated number Label lbl = new Label(); //add this label to stackPanel1 stackPanel1.Children.Add(lbl); })); Thread.Sleep(100); } Invoke will execute synchronously, so when the call has been executed, your thread will return, BeginInvoke will instead execute asynchronously. I have added a thread.sleep to suspend background thread for a while. In this case all the work done by background thread is to update the UI, so UI is always busy.

Categories : C#

Adding Controls to a panel in Parallel or Concurrent
Your code is way too complicated for what it's trying to do, especially since I don't see any advantage in using parallelism here. (Though there might be some reason in your real code, it's hard to tell from your samples.) I think you shouldn't use parallelism until you learn how it works. And programming using a trial-and-error approach should be avoided, because it means you don't actually understand your own code, so it leads to bugs. But the actual problem in your code doesn't have anything to do with parallelism. It's that you're using Random incorrectly. If you use the default constructor, Random is seeded with the current time. This means that if you create multiple Random instances in short succession, like you do, they are all going to return the same sequence of numbers. This me

Categories : C#

Adding styles to Parameters controls in SSRS 2008
You could try hacking the css in the report manager - not sure if that will 'pass through' to sharepoint. Maybe you could modify some css in sharepoint to this. Use a dom inspector such as Firebug, Chrome developer tools or IE developer tools to see where the styles are coming from. If you need to validate dates, you can do this in a stored procedure. Check the values of the parameters and kick out an error message. It's not pretty, but it works. IF DATEDIFF(m,@STARTDATE, @ENDDATE) > 0 RAISERROR(N'Date range must be less than one month',16,1)

Categories : Reporting Services

adding attribute to dynamic controls generated in javascript
For dynamically generated content you could use on $("form").on("change", function(event) { alert('Checkbox click!'); });

Categories : Javascript

C# WinForms, Adding a usercontrol Dynamically during runtime and controls are invisible?
It seems that you have called SuspendLayout() without telling the panel to ResumeLayout() pnl_ContactDetails.SuspendLayout(); for(int i = 3; i < details.Count; i++) { TextPrompt txtbox = new TextPrompt(details[i]); //Textbox to be added MessageBox.Show(details[i].value); txtbox.Name = details[i].name; //Sets properties txtbox.Location = new Point(25, y); txtbox.Size = new System.Drawing.Size(345, 45); txtbox.TextValueChanged += new EventHandler(txtbox_TextChanged); /* txtbox.Show(); */ // Leave this call out in favor of: txtbox.Visible = true; this.pnl_ContactDetails.Controls.Add(txtbox); txtbox = (TextPrompt)this.pnl_ContactDetails.Controls[i - 3]; //Checks to make sure controls are on form. MessageBox.Show(txtbox.ContactDetails.name);

Categories : C#

C# adding controls in site master wont reference in asp:loginView
Label ClubName= HeadLoginView.FindControl("ClubName") as Label; if(ClubName != null) ClubName.Text = "hello"; your aspx label ID is ClubName but in your code you access it as NameClub. Anyway you can't access controls inside LoginView directly. Use FindControl method and get the control as above. You better Read How to: Access Server Controls by ID

Categories : C#

Adding a button that will show up all the options
It maybe due to copy/paste but there is an error in your script: function keyHandler(event){ if (document.getElementById("shadow").style.visibility == "visible"){ var textfield = document.getElementsByName("text")[0]; if (key == 40){ //Key down //alert (words); if (words.length > 0 && **posi words.length-1**){

Categories : Javascript

Adding arguments to options in Rsync
Are you sure you're exercising the modified rsync? The man page for popt suggests POPT_ARG_INT: Value Description arg Type POPT_ARG_NONE No argument expected int POPT_ARG_STRING No type checking to be performed char * POPT_ARG_INT An integer argument is expected int POPT_ARG_LONG A long integer is expected long POPT_ARG_VAL Integer value taken from CWval int POPT_ARG_FLOAT An float argument is expected float POPT_ARG_DOUBLE A double argument is expected double The man page linked to has only one reference to CWval with no explanation of what it actually means.

Categories : C

Adding padding to select options
styling to select option is very much limited as to maintain a coherence and consistency among all the application in the operating system thus the browser are ought to restrict the style of some basic elements like in your case option tag. The restriction depends browser to browser, like padding and even margin of option tag works in the mozilla firefox while it doesn't works with chrome. If it is very much necessary in you website to style the option tag then I suggest you to use some jQuery plugin (you can also make a drop down of your own, its simple).

Categories : HTML

Adding "Options" column to JQGrid?
We can render the button using formatter callback function like below colNames : [ 'Name1', 'name2', ], colModel : [ {name : 'name1',index : 'id',width : 50,align : 'center'} , {name : 'name2',index : 'name2',editable : false,width : 120,formatter: function (cellvalue, options, rowObject) { if(cellvalue=='cond1'){ return "<input type='button' value='Add' onclick='func1(" + options.rowId + ")'/>"; } else if(cellvalue == 'cond2'){ return "<input type='button' value='Delete' onclick='func2(" + options.rowId + ")'/>"; } } } ]

Categories : Java

Adding options to a select box dynamically
The error is in the first line of the function function getTimes(); ^------ You have a semi colon here which is not supposed to be there Also is a better idea to cache your selectors if you are referencing the same element again. Bind the events using Javascript instead of binding them inline. // Store you selectors so that you can use later // This will improve your performance var classDropdown = document.getElementById("classes"), scheduleDropdown = document.getElementById("schedule"); // Abbd events using javascript classDropdown.addEventListener('change', getTimes); function getTimes() { var index = classDropdown.selectedIndex; if (index == 0) { scheduleDropdown.value = " "; } else if(index == 1) {

Categories : Javascript

Custom Controls and Web Resources (scripts)
I don't think you're taking the problem the right way. Using global variables (in js) especially when they're actually only used locally is a very bad idea. source Loading jQuery or a jQuery plugin more than once can also be a source of bugs. source What i would do is to think of another way of passing variables to your javascript, something like data attributes. You're probably having an html input generated with from server control, add data attributes for your dates : <input type="text" ... data-mindate="01/01/2013" data-maxdate="12/31/2013" /> Next step is, instead of feeding the global variables to the datepicker function, use the data attributes : $('#whatever').data('mindate'); or $('#whatever').attr('data-mindate'); And a fast demo : http://jsfiddle.net/JjemN/

Categories : Asp Net

Is it possible to add custom asp.net controls in Kendo Grid?
Read this to find out more about dropdownlists in Kendo UI grids. Read this to find out more about date pickers. Read this to find out more about checkboxes. So you can solve all of these, but you will get quicker responses in the future if you do not post composite questions, you have posted several problems in the same question. People do not answer it because they do not bother to solve all your problems in a single question. Also, you might like to know that defining the column types of the grid's data model (not remember how, as my Kendo UI days are gone and I do not read my old code unless it is absolutely necessary) is a source of miracles. I hope my post was helpful to you.

Categories : Asp Net

Custom Styling Qt Quick Controls
In Qt Quick Controls, there is limited styling available via Qt Quick Control Styles items, like ButtonStyle, CheckBoxStyle, etc. At the moment, other styles require delving into Qt sources and messing with internal details. Here is a complete example of how one might modify the toolbar's style. main.qml import QtQuick 2.1 import QtQuick.Layouts 1.0 import QtQuick.Controls 1.0 ApplicationWindow { toolBar: ToolBar { id: toolbar Component.onCompleted: toolbar.data[0].item.children = [newRectangle]; property Item _newRectangle: Rectangle { // The rectangle within the ToolBarStyle's panel // Gleaned from: // http://qt.gitorious.org/qt/qtquickcontrols/source/ // c304d741a27b5822a35d1fb83f8f5e65719907ce:src/styl

Categories : Qt

Dynamically adding options and optgroups in Select2
I found the answer buried inside the github discussion you linked to, the object structure for optgroups is as follows: { id : 1, text : 'optgroup', children: [{ id : 2, text: 'child1' }, { id : 3, text : 'nested optgroup', children: [...] }] } Demo fiddle

Categories : Javascript

Difference between Xcode's file adding options
If you choose Create groups the files will actually be located in one folder, but in Xcode they will appear grouped the way you had them in the folders. If you choose Create folder Xcode will create folders in your project directory and the structure will be like the structure of the imported folder/folders.

Categories : IOS

Adding dropdown options with JSON object
Your code should like following, function loadQuery() { var assign = $("#fcbCountry").val(); $.ajax({ type: 'get', url: '/WMT/model/getCandidate.cfc', data: { method: 'getRegions', country: assign }, dataType: 'json', success: function (result) { var options = $("#fcbRegion"); $.each(result.DATA, function () { options.append($("<option />").val(this[0]).text(this[1])); }); } }); } loadQuery();

Categories : Jquery

"Change" is being fired when adding options to select
As noted in a comment, unless you remove the element that's currently selected it should work fine. You can either add a condition to exempt option[selected] when you re-populate the list, or expect it to fire a change event when you manipulate the entire <select>. You can use .one coupled with .stopPropagation to ignore a change that's been triggered by reloading the list. Something like: var $select = $('#options'); $('#add').click(function(e){ var val = Math.floor(Math.random() * 1000), opt = 'option ' + val; $('<option>',{'value':'val','html':opt}).appendTo($select); }); $('#reset').click(function(e){ $select.one(function(e){ e.stopPropagation(); }); var newopts = { '0': 'Please select one...', '1': 'Option 1',

Categories : Javascript

Dynamically adding input controls to form, similar to Apple Mail Rules
Use JQuery.append( html_fragment) to dynamically build & append your desired HTML elements, into the TD or DIV container where you need them. See: http://api.jquery.com/append/ and also jQuery document.createElement equivalent? For example: var prefix = "cond0"; var content = "<select name='"+prefix+"_field'>"; // generate select options here.. content += "</select>"; // var container = $( "#"+prefix); container.append( content); Hope this helps.

Categories : Jquery

Implicit Styles not working on Custom Controls
Setting BasedOn="{StaticResource {x:Type Button}}" will get you WPF's default button style. If you want to use the style defined in your App.xaml, you'll need to add a key to that style so you could reference it from your control style: App.xaml <!-- Your style, just with an added x:Key --> <Style x:Key="myButtonStyle" TargetType="{x:Type Button}"> ... </Style> <!-- Set the above style as a default style for all buttons --> <Style TargetType="{x:Type Button}" BasedOn="{StaticResource myButtonStyle}"> Your control styles and templates <Style x:Key="DefaultButtonStyle" TargetType="{x:Type Button}" BasedOn="{StaticResource myButtonStyle}"> ... </Style>

Categories : Wpf

Custom Google Map v3 Controls Position Issue
This is happening because Google Maps API needs to know the width and the height of your control elements to know where to position them - when the map is rendered. By initially setting them to display: none, you are hiding it from the actual layout of your page as well - it's as if the element's not there. Use visibility: hidden instead - setting the visibility to hidden will still hide the element on the screen, but it is still present in the layout. For reference: http://www.w3schools.com/css/css_display_visibility.asp Also, I suggest rather than individually setting these CSS attributes to your custom control elements, add a class (you can do this via jquery's .addClass()) to these elements and toggle just by targeting the class. I've updated your jsfiddle here.

Categories : Javascript



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