FAQ Database Discussion Community


Adding to ListView columns not increasing column count

c#,winforms,listview,count,control
I have created a Form using the VS 2013 designer. I added a Listview control and added 13 columns via the Properties window. I then wrote a program in C# and I am able to access all of those columns using the item.SubItems[N] construct. Also, all of those column headers...

Is there any way to add an object other than CString to a CComboBox in MFC?

c++,mfc,override,control,ccombobox
I am trying to add an object that has a member variable CString to a CCombobox. I cannot just add the string because I am trying to interface with a tool that requires me to have another member variable other than just a string as a list item in the...

Comparison != doesnt work like I expect

python,comparison,control,operator-keyword,flow
I have this: salir = "" while salir != "s" or salir != "S": print("no has salido") salir = input("Digit s to exit or enter to continue) print("saliste") but the operator != doesnt work, but if I put this: salir = "" while not (salir == "s" or salir ==...

How to add a custom control to the TinyMce 4 toolbar

plugins,control,tinymce-4
I want to introduce a new Control to TinyMce that I can use in the toolbar. In my case I want to add an icon control that can be placed at the start of the toolbar to differentiate between editors. However there is almost no information about how to properly...

Problems with control flow structures using strings

java,if-statement,switch-statement,control
Below is method that asks for a medium that is either air, water, or steel. If what is entered isn't one of these, the programs ends. If it is a valid medium, it asks for a distance it will travel and calculates the time through each medium. The problem I...

How to select the contents of a textbox once it is activated?

vba,excel-vba,events,textbox,control
I have this simple Userform, where I only have TextBox1 and TextBox2. I enter some text in both of them. Assume the focus is on (the cursor is in) the TextBox2. When I click on TextBox1, I want the whole text in this control to be highlighted (selected). Thus I...

Is it possible to filter a control that refers to a subform?

vba,ms-access,filter,control,subform
This is the code I am referring to: Dim ctl as Control For Each ctl In Me.Form If ctl.ControlType = acSubform ctl.Filter = "[StartDate] <= [Date] and [EndDate] >= [Date]" ctl.FilterOn = True End If Next ctl Apparently this doesn't work (and it has nothing to do with the filter...

Changing the background color of AutoComplete DropDownList of TextBox

c#,control,gdi
How can I change the background color of the autocomplete dropdown list of a textbox? I have searched a lot but have not found any proper solution. The existing solutions use a panel or some other control to mimic the behavior of autocomplete but I want to change the color...

Input group addons altering the total width of an input group

html,css,twitter-bootstrap,twitter-bootstrap-3,control
I've noticed that when using control group addons with Bootstrap that the total width of the control group is larger than those controls that do not have addons. This width change does not seem to be affected by the number of addons used. <link href="http://getbootstrap.com/dist/css/bootstrap.css" rel="stylesheet" /> <div class="container-fluid"> <form...

Navigation from OnDoubleTapped method

c#,windows-runtime,windows-store-apps,control,pushpin
I've created a customized Pushpin ( Windows store) and i need to navigate whenever the control double tapped/clicked So i figured out that OnDoubleTapped(DoubleTappedRoutedEventArgs e) will do it,but when i tried .. it didn't work. The following code is from the Control code-behind protected async override void OnDoubleTapped(DoubleTappedRoutedEventArgs e) {...

How to capture RightMouse Click in empty area of tab control?

c#,tabs,control,area
I have a normal C# tab control. I want to execute a function when the user right-clicks in the empty area to the right of the right-most tab header (anywhere in the tab header area that's not a tab is ok too). I looked at positioning a hidden button in...

Is there a way to use Git to flag code for future review?

c#,git,control,code-review,revision
I am currently developing a desktop application in C#. As I am going through my code, I keep finding other pieces of code that need a second look or can be improved on... but I don't want to derail from my current mission. Is there a way in Git or...

C# Vlc ActiveX Play rtsp stream

c#,control,activex,vlc,rtsp
I have found a problem to embed and playing rtsp stream to VLC activex control. Once i already succeeded but now i cant i dont know why, Im trying to host at WPF a vlc control but its dont work , Its says like a dll is missing , "Failed...

Control sum from input boxes in javascript

javascript,control
I'm trying to make some controls in Javascript when I submit a form in HTML. Evertyhing works perfectly except the one that needs to check the sum of 2 fields. <script type="text/javascript"> function validation() { var count=0; if((document.getElementsByName("people")[0].selectedIndex) == "") {alert("How many PEOPLE?"); count++;} else if((document.getElementsByName("amount")[0].selectedIndex) == "") {alert("AMOUNT has...

Cross-thread work with Control which have a data source (ComboBox)

c#,multithreading,user-interface,data,control
At first I will post the code, it is short and quite clear. cb_currentProfile is a ComboBox filled with 3 items when form is loaded delegate void SetCurrentProfileCallback(int index); private void SetCurrentProfile(int index) // Set index of Combobox.SelectedItem { if (this.cb_currentProfile.InvokeRequired) { SetCurrentProfileCallback d = new SetCurrentProfileCallback(SetCurrentProfile); this.Invoke(d, new object[]...

Remove a Timer from List in runtime C#

c#,arrays,control
I'm trying to remove a Timer component from a List - foreach (Timer timer in timers) { if (timer.Tag.ToString()=="mytag") { timer.Enabled = false; timer.Tick -= OnTimerTick; timers.Remove(timer); } } But it gives error- Collection was modified; enumeration operation may not execute. Any help?...

Change the order of controls in a panel?

c#,wpf,control
Is there a simple way to change the order in which controls are displayed within a panel? I do not mean Z-Index. I mean explicitly setting the 'flow order'. Thank you.

SqlDataSource COntrol modify during RUntime, I mean Changing it to another sqldatasource control?

c#,asp.net,datagridview,control,sqldatasource
I have 2 sqldatasource control which is SqlDataSource1 and SqlDataSource2. At my Design page i make my Gridview bind to SqlDataSource1. Is it possible to change the binding from 1 to 2 for the gridview? when I Click a button during runtime?...

Subclass a silverlight templated control

c#,wpf,silverlight,control,custom-controls
I want to create few custom controls. Here is a screen shot of what I'm trying to achieve. Each control contains two parts, a label (TextBlock) and an editor (UIElement). The label part is common to all controls. I don't want to keep defining label in each custom controls I...

controlling two dc motors and servo with arduino code

arduino,control,motordriver
The code does not seem to be working but I have also just started learning how to code arduino. I'm trying to run two dc motors and one servo as steering for a robot car. How should I wright it so it works. All I'm trying to do is use...

Panel BackColor setting color of it's controls

c#,control,panel,backcolor
I want to set the background color of the panel area only but it somehow also sets the background color of its controls, what's wrong with it? public Form1() { InitializeComponent(); Panel p = new Panel(); p.Size = this.ClientSize; p.BackColor = Color.Black; // The button will also have black background...

MFC Dialog Controls in Ultra High Resolutions

mfc,dialog,control,spacing,high-resolution
I am having trouble with the spacing and size of dialog controls when using my application in an ultra high resolution environment. I place the controls using the following code in a for loop: GetClientRect(cRectDimen); int iHalf = cRectDimen.right / 2; int iY = cRectDimen.top; int iX = cRectDimen.left+5; int...

D3 tween - pause and resume controls

javascript,d3.js,control,tween
I am trying to edit this d3 example. More specifically, I will try to apply the pause-resume controls of a pause resume guide in addition with a control bar like this we have under videos. At the end I imagine to have something like this: How can apply the pause...

I am stuck on my programming project

structure,control
A large company pays its salespeople on a commission basis. The salespeople receive $200 per week plus 9% of their gross sales for that week. For example, a salesperson who sells $5000 worth of merchandise in a week receives $200 plus 9% of $5000, or a total of $650. Your...

Python 2.7 Control Flow

python,python-2.7,control,flow,password-generator
I'm currently have a little problem: I'm making a "command" for my bot, a little password generator, currently, I already have the command itself, it'll go like this if Command.lower() == '!pwgen' #First message, the user calls the command length = Argument[0] #The length he wants, Argument[0] == the length...

Iteration over dynamically added nested controls

c#,winforms,iteration,control
I have a GroupBox on an WinForm. Another GroupBox is added in run time within the first GroupBox. Few PictureBox controls are added within the second GroupBox. Now I would like to iterate the PictureBoxes. Currently my code is: foreach (Control gbFirst in this.Controls) { GroupBox firstGroupBox = gbFirst as...

IOS/xcode/coredata: Implement calendar control using core data

ios,core-data,calendar,control,eventkit
IOS newb here trying to implement an open source calendar control MADay in my project with the data stored in core data. The calendar control does not provide documentation for accessing core data. I am guessing that I need to create an NSArray after pulling the events from core data...

How to except a control from validating when use ASP.NET validation controls?

asp.net,vb.net,validation,control
I have some Textboxs in my .aspx page which has some validation controls (for example requiredValidator control). I want to execute these validation controls when I click only on a special control but not others. What should I do?...

Controls do not fit to form resizing WPF

c#,wpf,control,dock
I'm trying to create an app responsive, all the effort I'm putting is not giving me results on the new standard WPF.   I would make sure to resize the application controls when the form is shrunken or expanded. As you can see from the pictures item 3 is not...

SaveImage of ChartControl without display It in the screen

c#,image,control,microsoft-chart-controls
I wanna save a ChartControl to an Image without display it in the screen. var theChart = new Chart(); var theSeries = new Series("values"); theSeries.IsVisibleInLegend = false; theChart.Series.Add(theSeries); theSeries.Points.AddXY(1, 1); theSeries.Points.AddXY(2, 2); theSeries.Points.AddXY(3, 3); theChart.SaveImage(@"D:\Téléchargements\HiddenChart4.png", ChartImageFormat.Png); Then I get a blank picture. I think it's because the control is not...

How to use reflection to cast a control as its type in order to modify properties?

c#,list,reflection,properties,control
Here's an example of what I currently do: book enable = false; foreach (Control c in controlList) { if (c is MyTextBox) { (c as MyTextBox).Enabled = enable; } if... ... } Instead of having multiple if statements for every type of control, is there a way to get the...

Strange effect when resizing Control

c#,winforms,control
I have created two custom controls. A rectangle and an ellipse. I'm am able to move them by dragging with the mouse, but I also want to resize them. The rectangle resizing works fine, but resizing of the ellipse gives a strange effect. When I click on the ellipse after...

Finding page controls starting with some string

c#,asp.net,textbox,control,findcontrol
I have many of TextBoxes in the ASP.NET page that their ID starts with certain string like xyz(e.g: xyz1,xyz11,xyz999). I know FindControl method, but it finds only by complete ID of Control. How can I find controls in which their ID be like that on page?...

Custom Control check if resizing is started

c#,winforms,control
I have created a custom Control called Ellipse. I'm able to resize, move, and paint this Ellipse. Now I'm trying to add undo/redo functionality for the resizing. The user can resize the control at the bottom right corner. At the moment the control prints hello as long as the cursor...

Loop through every control on a Form (including those in Containers) and replace a text placeholder with a setting value

vb.net,visual-studio-2013,control
In my project I have a setting called DriveLetter and I wish to insert the value of this setting in to the text of several controls on a form (replacing a placeholder). I thought the easiest way to do this would be to loop through each control on the form...

How to set 40 bytes of data to mixer control using tinymix?

audio,control,alsa,tinyalsa
I have a control called EQ2 Coefficients the output of the tinymix command gives 65 BYTE 40 EQ2 Coefficients 00000fc803fe00e01ec4f136040904cc1c9bf337040b0cbb16f8f7d9040a1f14058c056340000b75 How can I set that mixer control to something other value for example the value to be written into the control is 00000fb3040001341E4FF1A5040B06831B64F448040A10F413DDFA1D040A280D02A104A840000000 using tinymix command?...

Convert CWnd* to myControl*

c++,casting,mfc,control,cwnd
I am trying to convert a CWnd* pointer to a custom control pointer. The custom control just extends CEdit. Below is what I have. pWnd was passed in. it is a CWnd*. calEdit* test = (calEdit*)pWnd->GetDlgItem(pWnd->GetDlgCtrlID()); When I try to debug and see what the value of test is, none...

Trying to delete the selected item in the XPages repeat control, but does not work

xpages,control,repeat,delete-row
I am trying to delete the selected item in the Xpages repeat control, but it does not work. Please help? Here is my code in the repeat control section <xp:repeat id="repeat1" rows="30" var="eachQuestion" value="#{questions}" indexVar="rowIndex"> <tr> <td>...</td> <td> <xp:link styleClass="btn btn-danger" id="deleteLink"> <xp:eventHandler event="onClick" action="#{javascript:eachQuestion.getDocument().remove(true);}" submit="true" refreshMode="partial" refreshId="listContainer" /> <i...

Get all controls with names that start with specific string

c#,winforms,search,control
For a school project we are creating a C# application where children can learn. I made a template in the windows form and want to change the placeholder with the choice of the child, so it can become 1x choice, 2x choice, etc. I gave every label a name that...

foreach fills from bottom to top

c#,winforms,search,control
My foreach goes the wrong way. It's now setting the template from bottom to top but this needs to go in opposite order I have added a printscreen to make it clear: The only solution I know is to select them 1 by 1 by name and then set the...

Change button color using keyboard shortcut C# WPF

wpf,colors,control,inputbinding
I'm getting into some C# WPF, and am creating a simple word processor to convert normal text into wiki markup. I am new to WPF and am having trouble with something seemingly minuscule, and hopefully an easy fix. I have a Bold button on my main form. When pressed it...

Image animation with speed control

javascript,jquery,performance,animation,control
We have some problem with our image animation with speed control. It make use of a timeout to change the image, but we want to change the timeout value with a slider, but for some sort of reason, it doesn't work. Can someone help us out ? We have a...

What control should I use to display visual, manipulable elements?

c#,visual-studio-2012,control
I want to develop a level editor using visual studio 2013 and c#. I know c/c++ but am new to C# and want to start simple. I want to use a control that will allow me to handle events from the mouse (get clicks, click release, get position inside the...

Winforms Control using custom class property doesn't refresh

c#,winforms,control
I've been searching for a solution but I can't seem to find one, though I guess this might be simple.I've built a custom control with a property that is a Class. When I change any of this class properties, my control doesn't automatically refresh (neither in the designer nor programmatically)....

How to 'select' correct Textbox out of List which are created dynamically?

c#,list,textbox,control
In a school project I have to create 'dynamic' (if that's the correct term) textboxes in a MouseClick event.. By clicking the recently created textbox another Form will be opened (by another MouseClick event). In that new Form I want to change the text from the recently created textbox to...

dinamcally adding controls C#

c#,winforms,control
I'm trying to create a new label on the initialization of the application. I've run trough other questions and answers and made something like this: public Form1() { InitializeComponent(); try { foreach (Button b in Controls) { FillBoard(b); } Label tScore = new Label(); tScore.Size = new Size(244, 22); tScore.Location...