Have you tried using flowLayoutPanel? it is a control panel that will align and position all controls inside it automatically for yourself it has 4 direction in the property FlowDirection, try using that and I think you will just have to use this configurations flowLayoutPanel.FlowDirection = FlowDirection.LeftToRight; flowLayoutPanel.WrapContents = true;...
You can set a background image on a Grid In XAML: <Grid> <Grid.Background> <ImageBrush ImageSource="myimage.png"/> </Grid.Background> <!--Your controls here--> </Grid> ...
I need to get the name of the two checkboxes You've already got a loop; use it: For Each CheckBox In CheckBoxArray If CheckBox.Checked = True Then Debug.Print(CheckBox.Name) End If Next ...
You can use Where extension method of LINQ TextBox[] title = MView.Controls.OfType<TextBox>().Where(d=>d.Name.Contains("title")).ToArray(); Also you can add multiple condition TextBox[] title = MView.Controls.OfType<TextBox>().Where(d=>d.Name.Contains("title") || d.Name.Contains("data")).ToArray(); ...
I suspect that this isn't actually creating a class member: <script runat="server"> public string MacName = "UNKOWN"; </script> Instead, put it on the code-behind as a class-level property: class control1 { public string MacName { get; set; } // etc. } Then you should be able to set it on...
vb.net,winapi,controls,click-through
If you don't want a window to receive input you have to disable it, calling the EnableWindow function: Enables or disables mouse and keyboard input to the specified window or control. When input is disabled, the window does not receive input such as mouse clicks and key presses. Mouse messages...
You cannot do this. Events only allow you to add or remove handlers, you cannot get a list of all of the handlers that they have. It is a function that is intentionally removed from you. You could keep track of the handlers you assign to a particular button yourself,...
EDIT: This control can be reused throughout a project as many times as you need it acts exactly as any other control would and is used the same way as any other control library. There is no Border effect and you can add whatever hover effect you want. This is...
c#,forms,user-interface,controls
SuspendLayout/ResumeLayout are typically used when you are adding controls to FlowLayoutPanel and don't want layouting to occurs after each addition. It is suspended until you say resume (possibly even forcing it). In your case, you already have collection of controls ready. Changing WrapContents will cause layouting (obviously), but only once....
The control isn't being found because you are searching the Form's Controls() collection, instead of its actual container, tabPage4. Change: ListBox listboxTest = Controls[("lst" + variableNameString)] as ListBox; To: ListBox listboxTest = tabPage4.Controls[("lst" + variableNameString)] as ListBox; Or search for the control as in the link provided by drzounds in...
The label can be referenced as item 0 in the parent control's .Controls collection, and the label's text is its .Caption property. If IsNull(Me.EditControl) Then msgbox "My label's text is: " & Me!EditControl.Controls(0).Caption Elseif IsNull(Me.ComboboxControl) Then msgbox "My label's text is: " & Me!ComboboxControl.Controls(0).Caption End If ...
Don't expose the UI controls or maintain references to other controllers. Instead, expose some observable data in the controllers, and use bindings to bind everything together. For example, suppose you have a Table.fxml file which displays a TableView<Person> (Person is just the example data class) and has a corresponding controller:...
c#,xaml,event-handling,windows-phone,controls
Button's Click event doesn't have a parameter type of EventArgs.According to MSDN page , it has to be RoutedEventArgs So your code must be : public void button_Click(object sender, RoutedEventArgs e) { var button = (Button)sender; if (button.Style != myButtonStyle) button.Style = myButtonStylePressed; else button.Style = myButtonStyle; } ...
This is a strongly typed variable: Form frmPDF = Application.OpenForms["frmPDFs"]; So frmPDF is now an instance of type Form, which is the base class for your form. It's not the type of your actual form. (It's an instance of your specific form type, but that instance is known to the...
If you have the timer ticking every 250ms that could prevent the event on the mouse click. I would check that you stop the timer after the tick if you no longer need it, and restart as I think you are doing when the user leaves the control or enter...
You could go about this a few ways. One of which would be to add a SearchFunctions object as a a property to your Form1 class. Then use that object to call the method that adds the controls. public partial class Form1 : Form { SearchFunctions src = new SearchFunctions();...
c#,linq,controls,readonly,tabstop
To linqify your example: foreach (var control in Controls.OfType<TextBox>().Where(c => c.ReadOnly) { control.TabStop = false; } However, your example does not process all controls because a Control can contain other control. You will need a recursive descent algorithm. IEnumerable<Control> Walk(Control control) { yield return control; foreach (var child in control.Controls.SelectMany(c=>...
c#,forms,controls,dynamically-generated
to avoid errors: Add the controls to an array and then remove them. try this: List<Control> controlsToBeRemoved = new List<Control>(); foreach (Control item in this.Controls.OfType<PictureBox>()) { controlsToBeRemoved.Add(item); } foreach (Control item in controlsToBeRemoved) { this.Controls.Remove(item); } ...
c#,forms,user-interface,controls
Use a Panel control (as you guessed) and set its AutoScroll property to true (this takes care of scroll bars). If your inner controls are some other UserControl objects, keep a list of them in your outer UserControl, and add them dynamically at the bottom of the stack: var innerControl...
Well you've downloaded the source code. Place the source code in a specific location on your pc and then compile it 9If your planning to use this control in your own project then compile it in release mode. Assuming that there are no compile errors close visual studio and then...
For an edit control, notifications are sent to the original parent of the control. That is, in your case, the message only window. In a comment to a similar question Raymond Chen says: Many controls cache the original parent. Not much you can do about it. You may be best...
c#,wpf,triggers,controls,datatrigger
It should be: <Style.Triggers> <DataTrigger Binding="{Binding IsExpanded, ElementName=_expFilter}" Value="True"> <Setter Property="Height" Value="140"/> </DataTrigger> </Style.Triggers> You have IsExpaned...
You can change the name of the sublayout item without it affecting things. If you change the actual sublayout ascx file then you need to also change the reference field in the sublayout item but everything else is bound by the id of the item not the name....
Sites bind a Component to a Container and enable communication between them, as well as provide a way for the container to manage its components. Sites can also serve as a repository for container-specific, per-component information, such as the component name. For more information about components, see Programming with Components....
Your code is correct. May be there's any TextBox missing which doesn't have Green color, or might be you've calculated them wrong. Edit: As you explained all TextBoxes are contained in GroupBoxes, so you've to iterate through all groupBoxes. bool IsAllGreen = true; foreach (GroupBox groupBox in this.Controls.OfType<GroupBox>()) //get all...
There are some issues with your code: Why use a static event handler and then use a work-around to access an instance variable when you could just use a non-static event handler in the first place? The timer class you use is System.Timers.Timer, there are several more different timer classes,...
WPF ComboBoxes are not the same as WinForms ones. They can display a collection of objects, instead of just strings. Lets say for example if I had myComboBox.ItemsSource = new List<string> { "One", "Two", "Three" }; I could just use the following line of code to set the SelectedItem myComboBox.SelectedItem...
All you have done is assigning new_panel variable to pnl_page_active. It has nothing to do with Control hierarchy. You need to remove the old panel from it's parent and insert the new one: Control parent = pnl_page_active.Parent; if (parent != null) { parent.Controls.Remove(pnl_page_active); parent.Controls.Add(new_panel); } ...
The repeated keydown events that occur when a key is held down are generated by the keyboard hardware. On the PC, the protocol definition says: If you press a key, its make code is sent to the computer. When you press and hold down a key, that key becomes typematic,...
No need to do Owner Draw, you can just use SetWindowText() and handle the WM_CTLCOLORSTATIC message, see the code in this SO Answer <-- this will not work if the window has a pattern background, we need to subclass the static control and use the transparent background mode while drawing...
c#,jquery,asp.net,controls,globalization
Add this in ResourceClearing.aspx.vb for testing ru-RU culture. Do not set the culture outside of InitializeCulture: protected override void InitializeCulture() { Thread.CurrentThread.CurrentCulture = new CultureInfo("ru-RU"); base.InitializeCulture(); } Add this in ResourceClearing.aspx Page <asp:DropDownList ID="ddlCurrency" CssClass="form-control" runat="server" Height="16px"> <asp:ListItem Value="1" Text="<%$ Resources:shekelOpt %>"></asp:listitem> <asp:ListItem Value="2" Text="<%$ Resources:dollarOpt...
vb.net,winforms,controls,datetimepicker
Figured out the my mistake. I needed to handle the 'DateSelected' event and not the 'DateChanged' event. DateChanged events are getting fired as part for the month changes when clicked on the left/right navigator button and also when the year changes.
I've posted this as an answer so you can check it as valid. For anyone having this problems, the first thing I would check is if autolayout is enabled on your view's interface builder. Open your view in the Interface Builder. Now, on the utilities, show the file inspector. You...
c#,winforms,dynamic,delete,controls
Dispose is removing the control from the Controls collection as well as disposing of the control. As noted here, When a Control is removed from the control collection, all subsequent controls are moved up one position in the collection. That is why your logic is skipping every other CheckBox. Try...
Using the "Object" Datatype worked. I needed to set it equal to the control using a Set statement SET mCombo = ssOLEDBCombo I am more familiar with vb.net/c# where this Set keyword isnt necessary....
.net,vb.net,if-statement,textbox,controls
A variation from the solution from Mr Wilko is through the creation of specific arrays of your controls. Dim aftBoxes = new TextBox() {aft1, aft2, aft3} Dim ainBoxes = new TextBox() {ain1, ain2, ain3} Dim bftBoxes = new TextBox() {bft1, bft2, bft3} Dim binBoxes = new TextBox() {bin1, bin2, bin3}...
c++,visual-studio,visual-c++,controls,designer
As I know,if you use MFC or windows SDK,you must compute controls' new size and change it at runtime.You can change controls' size by SetWindowPos(a windows api) at runtime.
xaml,silverlight,windows-phone-8.1,controls
You could take a look at the Calendar control for WindowsPhone Silverlight from ComponentOne. You could download it from https://www.componentone.com/Downloads/Download/?downloadID=133 and refer to its documentation at : http://helpcentral.componentone.com/nethelp/WPCalendar/
c#,winforms,controls,messagebox
Well, the answer you are looking for is NO. It is not possible to add other controls to MessageBox. If the current MessageBoxButtons enum doesn't provide you with your required buttons then you have no other option then to make your own, using a standard Form or a UserControl. You...
as Suggested, i shifted the creation outside (credit to Sinatr for spotting it) FlowLayoutPanel fwPanel = new FlowLayoutPanel(); private void createFLP() { int panelWidth = width * 4 + 50; int panelHeight = height * 4 + 50; fwPanel.Size = new Size(panelWidth, panelHeight); fwPanel.Location = new Point(0, 0); this.Controls.Add(fwPanel); }...
delphi,dataset,controls,editing,tdbgrid
I think you might be confusing two things, namely changes being relayed back from DB-aware controls such as TDBEdits to the corresponding dataset TFields objects of the dataset, and changes in the field values being posted back from the fields to the dataset's database data. That's partly why I suggested...
c#,wpf,winforms,properties,controls
My recommendation: Decompile the dll and manually change the designer/xaml, then recompile (assuming you have all dependencies). There are a several free decompilers for .NET. I typically use ILSpy....
c#,winforms,reference,controls
So I solved it! Jon Skeet was right. The Tab in the TabControl didn't contain the controls I was looking for because they were all in a GroupBox! I searched for them in the GroupBox and there they were. The CheckBoxes where unchecked and everything worked perfectly as it should....
loops,excel-vba,controls,togglebutton,userform
These are each an array of 1. BOOK = Array("TYPE1, TYPE2") STRAT = Array("FAST,MEDIUM,SLOW") They should be, BOOK = Array("TYPE1", "TYPE2") STRAT = Array("FAST", "MEDIUM", "SLOW") Variant arrays are typically zero-based; the first element in the BOOK array is at BOOK(0). They use a 1 based index when filled directly...
c#,winforms,c#-4.0,controls,property-binding
It is possible to do via the designer. For your control -> Properties -> Binding... But it is a lot of steps to result in a line of code in the designer file which you can add yourself just as easily in the constructor: this.groupBox.DataBindings.Add( "Enabled", this.myCheckBox, "Checked" ); ...
asp.net,vb.net,textbox,controls
Yes you can do this but first you have to find the control in which textboxes are placed.If they are directly in page than this code will work this.Controls.OfType<TextBox>().ToList<TextBox>().ForEach(a => a.Text = ""); If textboxes are inside another control first you will have to find that control Control ctrl =...
The problem is that the code you are using mis-handles interface reference counting. Here are the relevant extracts: type TEnumString = class(TInterfacedObject, IEnumString) .... Note that this class is derived from TInterfacedObject and so it manages its lifetime using reference counting. Then the code goes on like this: type TAutoCompleteEdit...
I think this answer work correctly: public void JustCallEventByUser<TEventArgs>(Action<object, TEventArgs> method, object sender, TEventArgs e) where TEventArgs : EventArgs { var frames = new System.Diagnostics.StackTrace().GetFrames(); if (frames == null) return; // // This method (frames[0]= 'JustCallEventByUser') and declaration listener method (frames[1]= '(s, e)=>') must be removed from stack frames if...
c#,winforms,menu,telerik,controls
The issue is that you are deleting the control out of the collection that you are iterating through, which causes a change in the collection and causes the loop to fail. I would suggest using a different style of loop to accomplish this. For example: private void radMenuItem3_Click(object sender, EventArgs...
Try to Use Following : dateTimePicker1.MinDate = new DateTime(year, month,day); dateTimePicker1.MaxDate = new DateTime(year, month,day); dateTimePicker1.ShowUpDown = true; dateTimePicker1.Format = DateTimePickerFormat.Custom; dateTimePicker1.CustomFormat = "MMMM dd"; To disable Days before the first day of current month: dateTimePicker1.MinDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1); Limit Future Date : MaxDate is used as follows...
Try putting your long-running code in the Load event handler instead. By putting it in the Shown event handler, it causes the form to freeze until it's done loading because the shown event handler is not letting other events in the message loop, e.g. the Paint event -- get processed....
c#,xaml,silverlight,controls,stack-overflow
I stumbled upon that splendid effect myself, and as it turned out: You can't instantiate an object derived from UIElement (your line <local:Control1/> tries exactly this) in a ResourceDictionary (and generic.xaml is one), because all objects in said dictionary must be shareable. Documented here. Relevant section: Shareable Types and UIElement...
When you create your label. Do this lbl.MouseDown += lbl_MouseDown; Then in your EventHandler: MessageBox.Show(((Label)sender).Name); To clarify; sender will be the object triggering the event so you need to cast it to Label and then you will be able to use its properties....
turns out there's a BringToFront(); I was looking for bringToFront();...
html,json,angularjs,dynamic,controls
This is pretty easy using the ng-repeat directive. Note how I assign the value of the model back to the scope variable in the ng-repeat. This allows me to retrieve it later. angular.module('formModule', []). controller('DynamicFormController', ['$scope', function($scope) { //Set equal to json from database $scope.formControls = [{ name: "Name", type:...
c#,asp.net,class,webforms,controls
I found a solution to this in the end but was unable to find an easy means to getting all of the controls. I had to go looking for them within the other controls and eventually found them here: ArrayList PageObjects = GetPageControlIDs.AddControls(this.Controls[0].Controls[0].Controls[3].Controls[13].Controls[1].Controls[3].Controls, array, constPageID); ...
linux,controls,restore,alsa,mixer
The initial state of mixer controls is determined either by the driver or by the device itself. Furthermore, when asound.state does not yet exist, many distributions will call alsactl init. If you want a mixer control to have a specific value, you must set this value somehow. If you don't...
With such a vague, not-very-useful code example, it's impossible to say for sure what is wrong. That said, IndexOutOfRangeException, along with that apparently you are initializing the equipCore array once, using a field initializer, suggests that at the time it's initialized, the skillTotal variable is still set to its default...
it would look something like this (based on a winforms example) List<string> listBoxNames = new List<string>(); foreach (Control control in tabPage1.Controls) { if (control.GetType() == typeof(ListBox)) { listBoxNames.Add(control.Name); } } Or the same thing in linq syntax List<string> listBoxNames = (from Control control in tabPage1.Controls where control.GetType() == typeof (ListBox)...
javascript,html5,audio,video,controls
looks like three small changes where needed 1/ quotes only around the click not the whole of the addEventListener parameters 2/ call the initialize 3/ remove extra period from function.vidmute <script> var mutebtn; intitializePlayer() // **don't forget to call the initialize** function intitializePlayer(){ //set object references vid = document.getElementById("bg"); mutebtn...
You say that you cannot use a separate thread and that you must repaint often enough to give the user feedback. Repainting is expensive. Paint every 10th iteration or every 100ms to reduce the overhead....
Set csAcceptControls flag for ControlStyle. constructor TGroupPanel.Create(AOwner: TComponent); begin inherited Create(AOwner); ControlStyle := ControlStyle + [csAcceptsControls]; end; ...
asp.net,winforms,controls,webpage,topmost
No, you can not do this. If you're expecting to port a winforms application to webforms feature for feature, you're going to be greatly disappointed. WebForms is still just a thin veneer over the http protocol; one that tends to peel up at the corner. If you're trying to keep...
Your code isn't compiling because it is vb.net code. It should go without saying (but I'll say it anyway) that vb6 and vb.net are not the same thing. If you want to use an array, you will have to dimension the array with a number that is one less than...
Did you actually try? Where did you read that it was not possible? I've not done much with palettes, but searching "palette qt 5.2" gave me SystemPalette as the second result, and it's been around since Qt 4.7. The properties are read-only, so the intention must be that you set...
You can do what you are asking but with FindControl and concatenating it properly. If CType(FindControl("txtOC" & l & "_D"), TextBox).Text <>"" Then CType(FindControl("txtOC" & l & "_D"), TextBox).Visible=true If you have trouble finding the control, put them in a placeholder and call the FindControl on the place holder object....
javascript,video,width,controls,video.js
You just have to hide overflow in the controlbar .vjs-control-bar { overflow: hidden; } I setup an example fiddle here: http://jsfiddle.net/kuhmaty9/2/...
Based on your description, I think this is what you want. If not you need to give us more info on what doesn't work. I think the problem you are facing is that your event are assigned AFTER you call ShowDialog(), which is modal. This means that the method will...