Search Results

Search found 2806 results on 113 pages for 'winforms'.

Page 11/113 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • WinForms equivalent of performSelectorOnMainThread in Objective-C

    - by jamone
    I haven't done much multithreading before and now find the need to do some background work and keep the UI responsive. I have the following code. data.ImportProgressChanged += new DataAccess.ImportDelegate(data_ImportProgressChanged); Thread importThread = new Thread( new ThreadStart(data.ImportPeopleFromFAD)); importThread.IsBackground = true; importThread.Start(); void data_ImportProgressChanged(int progress) { toolStripProgressBar.Value = progress; } //In my data object I have public void ImportPeopleFromFAD() { ImportProgressChanged(someInt); } But the UI doesn't get updated since the ImportProgressChanged() call is made on the background thread. In objective C I know you can use performSelectorOnMainThread and pass it a method to call using the main thread. What is the equivalent way of calling ImportProgressChanged() from the main thread?

    Read the article

  • How come nobody wrote RadioMenuItems class for Winforms?

    - by Pavel Radzivilovsky
    Or maybe google is just not so friendly to me? What I want is this simple thing: constructor that accepts an array of menu item objects Value get/set property that would set all the Checked properties right bind to all Clicked events of the supplied items and provide One event Working DataBind facilities If you encountered such a nice thing around, please direct me. No need for manual do-it-in-your-form1.cs-class links, please. This I can do myself.

    Read the article

  • WinForms binding

    - by Anthony
    I have some controls bound to a BindingSource control. I want to do a calculation when the value changes in one control and set the result on another control. Do i update the textbox the property is bound to or do i update the underlying entity which would update the control anyway(i hope)? When i change textbox A...textbox B is updated with the new calculated result..this works fine...but i have noticed that when i Leave textbox A..textbox B reverts back to its original value...what is going on here!

    Read the article

  • winforms - gridview cell timespan edit problem

    - by Sharique
    I'm following this question for formatting timespan value in the gridview. Format TimeSpan in DataGridView column I'm diaplying only minutes value in grid as follows DataGridViewColumn idleTimeColumn = myGridView.Columns["IdleTime"]; idleTimeColumn.DefaultCellStyle.FormatProvider = new TimeSpanFormatter(); idleTimeColumn.DefaultCellStyle.Format = "m"; This cell is editable, so when I enter 5 (that mean 5 min) in the cell, then it should take it minute, but it take it as day value (ie, 5.00:00:00). I tried different values for format (mm,%m) but all these gives the same output.

    Read the article

  • Winforms: How to display a "loading" form?

    - by Martijn
    I have a grid and when a row is double clicked a form is loaded. However a lot of data must be loaded, so I'd like to display a simple form with the text 'loading, please wait..'. And when all loading is finished, the form must disappear. This is what I have right now, but it doesn't work: Code that invokes the form with lots of data: FormWithLotData form = new FormWithLotData(); form.ShowDialog(this); Constructor of FormWithLotData: // Show load form FormIsLoading frm = new FormIsLoading(); _CloseLoadForm closeForm = new _CloseLoadForm(frm.Close); System.Threading.Thread thread = new System.Threading.Thread(frm.Show); thread.Start(); InitializeComponent(); this.Visible = false; LoadAllData(); this.Visible = true; // Close load form Invoke(closeForm); Hope you can help me out. EDIT: I'd like to show an animated gif on the loading form.

    Read the article

  • WinForms form freezes

    - by andrew
    On a form (F1) i have a button, from which if i create another form (lets call it F2) and show it there's no problem but i'd like to do something like this Some thread in my app is running a connection and listens for messages from a server. when a message arrives, my main form is registered to get an event that runs a function. From that function i'm trying to create and show the F2 type form (empty, nothing modified in it): it shows it but then it freezes my application. more exactly: public partial class Form1 : Form { public Form1() { InitializeComponent(); ConnectionManagerThread.getResponseListener().MessageReceived += Form1_OnMessageReceived; } private void Form1_OnMessageReceived(object sender, MessageEventArgs e) { Form2 f2 = new Form2(); f2.Show(); } }

    Read the article

  • WinForms: Making a set of controls scale vertically.

    - by DonaldRay
    I have a Windows Form that displays several DataGridViews in the following layout: (No access to image hosting at work, so please pardon the ASCII art...) +-----------------------------------------+ ¦+-----------++--------------------------+¦ ¦¦ ¦¦ ¦¦ ¦+-----------+¦ ¦¦ |+-----------+¦ ¦¦ ¦¦ ¦¦ ¦¦ ¦+-----------+¦ ¦¦ |+-----------+¦ ¦¦ ¦¦ ¦¦ ¦¦ ¦+-----------++--------------------------+¦ +-----------------------------------------+ Unfortunately, when the user resizes the form to be taller, the form ends up looking like this: +-----------------------------------------+ ¦+-----------++--------------------------+¦ ¦¦ ¦¦ ¦¦ ¦+-----------+¦ ¦¦ | | || | | || |+-----------+¦ ¦¦ ¦¦ ¦¦ ¦¦ ¦+-----------+¦ ¦¦ | | || | | || |+-----------+¦ ¦¦ ¦¦ ¦¦ ¦¦ ¦+-----------++--------------------------+¦ +-----------------------------------------+ Instead of this: +-----------------------------------------+ ¦+-----------++--------------------------+¦ ¦¦ ¦¦ ¦¦ ¦¦ ¦¦ ¦¦ ¦+-----------+¦ ¦¦ |+-----------+¦ ¦¦ ¦¦ ¦¦ ¦¦ ¦¦ ¦¦ ¦¦ ¦+-----------+¦ ¦¦ |+-----------+¦ ¦¦ ¦¦ ¦¦ ¦¦ ¦¦ ¦¦ ¦¦ ¦+-----------++--------------------------+¦ +-----------------------------------------+ To reproduce this, anchor the Top-Left DataGridView to Top-Left, the Center-Left DataGridView to Left, and the Bottom-Left DataGridView to Bottom-Left, and the big DataGridView to all 4. What can I do to get the behavior I want?

    Read the article

  • Winforms - Visually remove button click event

    - by Wayne Koorts
    .NET newbie alert Using Visual C# 2008 Express Edition I have accidentally created a click event for a button. I then deleted the automatically-created method code, which resulted in an error saying that the function, which had now been referenced in the form loading code, could no longer be found. Deleting the following line from the Form1.Designer.cs file's InitializeComponent() function... this.btnCopy.Click += new System.EventHandler(this.btnCopy_Click); ... seems to do the trick, however, it makes me feel very dirty because of the following warning at the beginning of the #region: /// Required method for Designer support - do not modify /// the contents of this method with the code editor. I haven't been able to find a way to do this using the form designer, which I assume is the means implied by this warning. What is the correct way to do this?

    Read the article

  • Unselect Databound Combobox Winforms .NET

    - by joedotnot
    The problem: combobox is databound to a DataView, first item in the dataview is DataRowView whose fields are DBNull.Value; Combo DropdownStyle = ComboBoxStyle.DropDownList Loads fine, displays fine, selects fine, problem is to Unselect via code. Setting the SelectedIndex to 0 throws an exception. (Setting to -1 is a no-no as per msdn doco that says dont set SelectedIndex=-1 if databound) So how to unselect without throwing an exception ? For now i wrapped it into a try/catch to just ignore the error! EDIT: As asked by Hubeza, i worked on sample code to post. Did a stripped down version of the original code in C# (original is in VB.NET) and could NOT reproduce it either. Converted to VB.NET and could NOT reproduce it either ! In other words, SelectedIndex = 0 does work in the stripped down version! Currently further investigating what else could be wrong with the original code. EDIT2: Case Closed. Call me a stupid fool if you like, and apologies for wasting anyone's time - The error was originating from MyComboBox_SelectedIndexChanged event, which i neglected to check ! May as well post the sample in case anyone finds useful. private void LoadComboMethod() { DataTable dtFruit = new DataTable("FruitTable"); //define columns DataColumn colID = new DataColumn(); colID.DataType = typeof(Int32); //VB.NET GetType(Int32) colID.ColumnName = "ID"; DataColumn colDesc = new DataColumn(); colDesc.DataType = typeof(String); colDesc.ColumnName = "Description"; //add columns to table dtFruit.Columns.AddRange(new DataColumn[] { colID, colDesc }); //add rows DataRow row = dtFruit.NewRow(); row[colID] = 1; row[colDesc] = "Apples"; dtFruit.Rows.Add(row); row = dtFruit.NewRow(); row[colID] = 1; row[colDesc] = "Bananas"; dtFruit.Rows.Add(row); row = dtFruit.NewRow(); row[colID] = 1; row[colDesc] = "Oranges"; dtFruit.Rows.Add(row); //add extra blank row. DataRowView drv = dtFruit.DefaultView.AddNew(); drv.EndEdit(); //Bind combo box DataView dv = new DataView(dtFruit); dv.Sort = "ID ASC"; //ensure blank item on top cboFruit.DataSource = dv; cboFruit.DisplayMember = "Description"; cboFruit.ValueMember = "ID"; } private void UnselectComboMethod() { if (cboFruit.SelectedIndex > 0) { cboFruit.SelectedIndex = 0; } else { MessageBox.Show("no fruit selected"); } }

    Read the article

  • Not able to capture Enter key in WinForms text box

    - by Michael Hermes
    When the user is entering a number into a text box, I would like them to be able to press Enter and simulate pressing an Update button elsewhere on the form. I have looked this up several places online, and this seems to be the code I want, but it's not working. When data has been put in the text box and Enter is pressed, all I get is a ding. What am I doing wrong? (Visual Studio 2008) private void tbxMod_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { btnMod.PerformClick(); } }

    Read the article

  • DIY intellisense on XPath - design approach? (WinForms app)

    - by Cheeso
    I read the DIY Intellisense article on code project, which was referenced from the Mimic Intellisense? question here on SO. I wanna do something similar, DIY intellisense, but for XPath not C#. The design approach used there makes sense to me: maintain a tree of terms, and when the "completion character" is pressed, in the case of C#, a dot, pop up the list of possible completions in a textfield. Then allow the user to select a term from the textfield either through typing, arrow keys, or double-click. How would you apply this to XPath autocompletion? should there be an autocomplete key? In XPath there is no obvious separator key like "dot" in C#. should the popup be triggered explicitly in some other way, let's say ctrl-. ? or should the parser try to autocomplete continuously? If I do the autocomplete continuously, how to scale it properly? There are 93 xpath functions, not counting overloads. I certainly don't want to popup a list of 93 choices. How do I decide when I've narrowed it enough to offer a useful lsit of possible completions? How to populate the tree of possible completions? For C#, it's easy: walk the type space via reflection. At a first level, the "syntax tree" for C# seems like a single tree, and the list of completions at any point depends on the graph of nodes you've traversed to that point. Typing System.Console. traverses to a certain node in that tree, and the list of completions is the set of child nodes available at that node in the tree. On the other hand, the xpath syntax seems like it is a "flatter" tree - function names, axis names, literals. Does this make sense? what have I not considered?

    Read the article

  • How to get the height of Label control in Winforms

    - by bmutch
    My label is wrapping the text due to the length of the text. The height property returns the correct value only if there is a single line. How can I get the correct height? Thanks. Solution: I was creating the label dynamically and checking the height then. Later the panel on which the label was residing was added to a form, changing the panel's font and thus also changing the label's font and height.

    Read the article

  • Adding Events To WinForms?

    - by Soo
    Happy Friday! :D I have a TextBox on a WinForm and I want to execute some code every time someone presses a key inside of that TextBox. I'm looking at the events properties menu, and see the "KeyDown" event, but don't know how to add code to it. Happy coding

    Read the article

  • Winforms: Enabling Localization by default

    - by Obalix
    Is there an easy way to set the Localizable property to true for newly created usercontrols / forms? The scope of the setting should ideally be a solution or a project. In other words I want to say that this project/solution should be localizable, and then if I add a new form or control VS should automatically set the property to true.

    Read the article

  • Problem in creating different types of columns in a Winforms gridview

    - by Royson
    My windows form application has a grid view control with filename as a default column. User should create a column of following types Text, Number, Currency, Combo Box, Check Box, Radio Button ,Date time type (should display DateTimePicker control) and Hyper Link type. After that i want to pass all rows to next screen for further processing. We can create a column of these types in a grid view but how can i store it in a data table so that i can pass it to next screen. Or should i create a column in a data table and then assign data table to grid view by gridview.DataSource = dt; but can we create a these types of columns in a data table.

    Read the article

  • Spell check in winforms

    - by j-t-s
    In my win forms c# app, I want to be able to add spell check functionality. But, I want to do it my own way, and NOT use any other components. All I need is just an online service where i can send a request or something and it tells me whether or not the word i sent was spelled correctly. Preferred but not required: The ability for that online sevrice to also send back suggestions.

    Read the article

  • C# winforms: DataSet with multiple levels of related tables

    - by Jake
    Hi, I am trying to use DataSet and DataAdapter to "filter" and "navigate" DataRows in DataTables. THE SITUATION: I have multiple logical objects, e.g. Car, Door and Hinge. I am loading a Form which will display complete Car information including each Door and their respective Hinges. In this senario, The form should display info for 1 car, 4 doors and 2 hinges for each door. Is it possible to use a SINGLE DataSet to navigate this Data? i.e. 1 DataRow in car_table, 4 DataRow in door_table and 8 DataRow in hinge_table, and still be able to navigate correctly between the different object and their relations? AND, able to DataAdapter.Update() easily? I have read about DataRelation but don't really understand how to use it. Not sure if it is the correct direction for my problem. Appreciate any advise. Thanks!

    Read the article

  • WinForms "mini-windows"

    - by Poco
    I need to create some mini-windows, like the ones shown in the image bellow, in my winform main form. It would be nice if they could be draggable, resizable, and, mainly, closable. How can I approach this design? Has anybody already seen some control (with code available) implementing something similar?

    Read the article

  • Help with storing/accessing user access roles C# Winforms

    - by user222453
    Hello, firstly I would like to thank you in advance for any assistance provided. I am new to software development and have designed several Client/Server applications over the last 12 months or so, I am currently working on a project that involves a user logging in to gain access to the application and I am looking at the most efficient and "simple" method of storing the users permissions once logged in to the application which can be used throughout restricting access to certain tabs on the main form. I have created a static class called "User" detailed below: static class User { public static int _userID; public static string _moduleName; public static string _userName; public static object[] UserData(object[] _dataRow) { _userID = (int)_dataRow[0]; _userName = (string)_dataRow[1]; _moduleName = (string)_dataRow[2]; return _moduleName; } } When the user logs in and they have been authenticated, I wish to store the _moduleName objects in memory so I can control which tabs on the main form tab control they can access, for example; if the user has been assigned the following roles in the database: "Sales Ledger", "Purchase Ledger" they can only see the relevant tabs on the form, by way of using a Switch - Case block once the login form is hidden and the main form is instantiated. I can store the userID and userName variables in the main form once it loads by means of say for example: Here we process the login data from the user: DataAccess _dal = new DataAccess(); switch (_dal.ValidateLogin(txtUserName.Text, txtPassword.Text)) { case DataAccess.ValidationCode.ConnectionFailed: MessageBox.Show("Database Server Connection Failed!"); break; case DataAccess.ValidationCode .LoginFailed: MessageBox.Show("Login Failed!"); _dal.RecordLogin(out errMsg, txtUserName.Text, workstationID, false); break; case DataAccess.ValidationCode .LoginSucceeded: frmMain frmMain = new frmMain(); _dal.GetUserPrivList(out errMsg,2); //< here I access my DB and get the user permissions based on the current login. frmMain.Show(); this.Hide(); break; default: break; } private void frmMain_Load(object sender, EventArgs e) { int UserID = User._userID; } That works fine, however the _modules object contains mutiple permissions/roles depending on what has been set in the database, how can I store the multiple values and access them via a Switch-Case block? Thank you again in advance.

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >