Search Results

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

Page 79/113 | < Previous Page | 75 76 77 78 79 80 81 82 83 84 85 86  | Next Page >

  • Taking over someone else's code

    - by tom d
    I am taking over someone elses code. What are some good ways to learn what that programmer did as quickly as possible? I have been running it, stepping through it and looking at the callstack. What else can I do? Sorry I forgot to mention, but there is little documentation and I have been trying to fix simple problems. Thanks!

    Read the article

  • Why can I check some event handlers for null, some not?

    - by Inno
    Hi, I have a ugly piece of code that adds event handlers. The problem is, if the code is called multiple times, the event handlers are called multiple times. To solve the problem, I remove the event handler first and then add it. Now I've seen the following behaviour: Some event handlers can be checked like: if (object.event == null) { // // Code // } others of the form if (object.object.event == null) { // // Code // } I get a message like 'object.object.event' may only occur left of -= or +=. (Since I'm using a german version of visual studio, I don't know the correct translation to english). I have no idea why the behaviour looks this inconsequent so I would be grateful for some information on this. To be more specific: It's user control. if (myControl.Event == null) { // // works // } if (myControl.TreeView.NodeMouseClick == null) { // // doesn't work // }

    Read the article

  • TextBox change is not saved to DataTable

    - by SeaDrive
    I'm having trouble with a simple table edit in a Winform application. I must have missed a step. I have a DataSet containing a DataTable connected to a database with a SqlDataAdapter. There is a SqlCommandBuilder on the SqlDataAdapter. On the form, there are TextBoxes which are bound to the DataTable. The binding was done in the Designer and it machine-produced statements like this: this.tbLast.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.belkData, "belk_mem.last", true)); When I fill the row in the DataTable, the values from the database appear in the textboxes, but when I change contents of the TextBox, the changes are apparently not being going to the DataTable. When I try to save change both of the following return null: DataTable dtChanges = dtMem.GetChanges(); DataSet dsChanges = belkData.GetChanges(); What did I forget? Edit - response to mrlucmorin: The save is under a button. Code is: BindingContext[belkData, "belk_mem"].EndCurrentEdit(); try { DataSet dsChanges = belkData.GetChanges(); if (dsChanges != null) { int nRows = sdaMem.Update(dsChanges); MessageBox.Show("Row(s) Updated: " + nRows.ToString()); belkData.AcceptChanges(); } else { MessageBox.Show("Nothing to save.", "No changes"); } } catch (Exception ex) { MessageBox.Show("Error: " + ex.Message); } I've tried putting in these statements without any change in behavior: dtMem.AcceptChanges(); belkData.AcceptChanges();

    Read the article

  • New records added to DataGridView aren't displayed

    - by Ross
    I have a custom Order class, groups of which are stored in List<Order> and a DataGridView. I think the problem is in my implementation so here's how I'm using it: In the form enclosing DataGridView (as OrdersDataGrid): public partial class MainForm : Form { public static List<Order> Orders; public MainForm() { // code to populate Orders with values, otherwise sets Orders to new List<Order>(); OrdersDataGrid.DataSource = Orders; } Then in another form that adds an Order: // Save event public void Save(object sender, EventArgs e) { Order order = BuildOrder(); // method that constructs an order object from form data MainForm.Orders.Add(order); } From what I can tell from the console this is added successfully. I thought the DataGrid would be updated automatically after this since Orders has changed - is there something I'm missing? The DataGrid accepts the class since it generates columns from the members.

    Read the article

  • How to get the right row in a sorted DataView?

    - by ZeissS
    Hi, I have a DataGrid containing a small table. Until now, I had a double click handler on this grid which iterated over all rows to find the selected one: DataTable table = (DataTable)this.dataGrid.DataSource; int selectedRow = -1; for (int i=0; i<table.Rows.Count; i++) if (this.dataGrid.IsSelected(i)) selectedRow = i; break; } if ( selectedRow != -1 ) { DataRow row = table.Rows[selectedRow]; // More code ... } Problem: When the user clicks on a column header and sort the table, table.Rows does not return the right rows. It still contains the unsorted rows. How can I get the right column?

    Read the article

  • Hotkey (Not Global) WinForm .NET

    - by acidzombie24
    In my winform app i would like one special button to run a test everytime i press it. There are dozens of controls so implementing it in each one takes too much time. Is there a way i can set a hotkey so no matter what i am doing in the app i can press the key and it will fire off my event?

    Read the article

  • How do i make a picturebox selectable?

    - by acidzombie24
    I am making a very basic map editor. I'm halfway through it and one problem i hit is how to delete an object. I would like to press delete but there appears to be no keydown event for pictureboxes and it will seem like i will have it only on my listbox. What is the best solution for deleting an object in my editor?

    Read the article

  • Application window sent behind other windows on closing different thread (C#)

    - by david.murrant
    I'm writing a Windows Forms Application in C#.NET On startup, the application displays a splash screen which is running in a separate thread. Whilst the splash screen is showing, the main application is initialising. Once the main application has finished initialising, the main form of the application is displayed, and the splash screen still shows over the top. Everything so far is as expected. Then, the Splash screen is closed, which causes that thread to exit. For some reason, at the point, the main application windows gets sent behind all other open Windows, notably the Windows Explorer window where you clicked the .exe file to run the application in the first place! What could be causing the windows to suddenly jump "behind" like this?

    Read the article

  • Infinite loop when Selecting a panel?

    - by serhio
    I have a winform in witch I have a custom LongPanel with textboxes. In order to validate an eventually edited textbox when the user click somewhere out of textBoxY I use the following code: Private Sub LongPanel_MouseClick(ByVal sender As Object, _ ByVal e As MouseEventArgs) _ Handles MyBase.MouseClick _AttachedPanel.Select() End Sub In runtime application freezes at the "Select" line... I receive infinite panel Leave events(sender is a panel)... any idea why? EDIT: precision on panels parents: Form => SplitPanel => _AttachedPanel | _LongPanel (_LongPanel contains a reference to _AttachedPanel)

    Read the article

  • Format TimeSpan in DataGridView column

    - by Dan Neely
    I've seen these questions but both involve methods that aren't available in the CellStyle Format value. I only want to show the hours and minutes portion (16:05); not the seconds as well (16:05:13). I tried forcing the seconds value to zero but still got something like 16:05:00. Short of using a kludge like providing a string or a DateTime (and only showing the hour/minutes part) is there any way I can get the formatting to do what I want.

    Read the article

  • Threading in C#

    - by j-t-s
    Hi All Just looking for something ultra simple. I need to spawn a method off to a new thread. I don't care when or how it ends. Can somebody please help me with this? Thank you

    Read the article

  • Linq To Text Files

    - by j-t-s
    Hi All I have a Text File (Sorry, I'm not allowed to work on XML files :(), and it includes customer records. Each text file looks like: Account_ID: 98734BLAH9873 User Name: something_85 First Name: ILove Last Name: XML Age: 209 etc... And I need to be able to use LINQ to get the data from these text files and just store them in memory. I have seen many Linq to SQL, Linq to BLAH but nothing for Linq to Text. Can someone please help me out abit? Thank you

    Read the article

  • How do I remove a control if not a specific type?

    - by joek1975
    I have a control that I need to restrict the types of child controls that it can contain during design time (dragging a new control onto an existing control on the form designer). I tried to do this by overriding the OnControlAdded event: Protected Overrides Sub OnControlAdded(ByVal e As System.Windows.Forms.ControlEventArgs) MyBase.OnControlAdded(e) If e.Control.GetType() IsNot GetType(ExpandablePanel) Then MsgBox("You can only add the ExpandablePanel control to the TaskPane.", MsgBoxStyle.Exclamation Or MsgBoxStyle.OkOnly, "TaskPane") Controls.Remove(e.Control) End If End Sub This seems to work, however I get an error message from Visual Studio immediately after the control is removed: 'child' is not a child control of this parent. What does this mean? How can I accomplish this without errors occurring?

    Read the article

  • Displaying Data on the Windows Form

    - by The.Anti.9
    I'm searching files and returning lines that include the search text, and I'm not really sure the best way to display the information I get. Every time I get a match, I want to show, in some sort of control, the File it came from, and the whole text line. (aka streamreader.ReadLine() result). First I tried just putting it all in a read-only text box, but it doesn't have a scroll bar. What is the best form control to help me display this data neatly?

    Read the article

  • Is there any way to disable the "double-click to copy" functionality of a .NET label?

    - by DavidCarroll
    This is really annoying. I'm using the label as part of a list item user control, where the user can click it to select the list item and double-click it to rename it. However, if you had a name in the clipboard, double-clicking the label will replace it with the text of the label! I've also check the other labels in the application, and they will also copy to the clipboard on a doubleclick. I have not written any clipboard code in this program, and I am using the standard .NET labels. Is there any way to disable this functionality?

    Read the article

  • Create SQL parameters programmatically

    - by Neo
    Another annoying one for me but probably something simple. I have a number of possible where clauses for a query based on user input, my question is how can I add these programmatically? For instance: wherequery = @"WHERE fieldname = @p_FieldName AND "; if (txtValue.textLength > 0){ wherequery += "fieldname2 = @p_FieldName2 AND "; } query = @"SELECT * FROM tabe" + wherequery; sql = connection.CreateCommand(); sql.CommandText = query; How would I go about doing the parameters for that? I've tried ArrayLists, Dictionaries and a few other methods but can't find a way of doing it. Ideally I'd want to do something like this: SqlParameter[] sqlparams; wherequery = @"WHERE fieldname = @p_FieldName AND "; if (txtValue.textLength > 0){ wherequery += "fieldname2 = @p_FieldName2 AND "; sqlparams.Parameters.Add("@p_FieldName2 ", SqlDbType.VarChar).Value = txtValue.text; } query = @"SELECT * FROM tabe" + wherequery; sql = connection.CreateCommand(); sql.CommandText = query; sql.Parameters.Add(sqlparams);

    Read the article

  • Is prefixing Windows Forms control names with their type OK?

    - by name
    I have seen many responses that say that prefixing variables with their type is bad, since C# is statically typed and we have Intellisense, but I find that prefixing the names of the controls is useful because I don't need to remember the name of the controls or switch to the designer frequently. For example: btnLoad // Button tbFilePath // TextBox tvFileSystem // TreeView Is this considered bad? If it is, what's the alternative?

    Read the article

  • How do I create an editable databound combo box in a DataGrid in WinForm

    - by signaldev235
    I have a noob question. I have a WinForm (.net 2.0 in VS 2008) on my from I have a DataGrid One of the fields in that datagrid is a combo box that is bound to a separate table. this works, but I am unable to edit or add, I cannot add a value that is not on the list. I am looking to create a lookup box for lack of a better term. The form is for Parts Order Entry In the data Grid Data Source is PartsOrder_table, the Work order Field is a int in the PartsOrder_table, and the combo box is bound to the WorkOrder_table. The WorkOPRder_Table has WorkOrd_ID int and WrkOrd nvarchar(10) the Combo Box Data Source is WorkOrd_Table Display Member is WorkOrd Value Member is WorkOrder_ID This works great with the problem that I cannot add or select anything not in WorkOrder_table. Any Help would be greatly appreciated. Thanks

    Read the article

  • Does Adding more namespace in the code file affect performace ?

    - by Harikrishna
    If we imports more namespace in the code file(cs file) then it affects on perfomance ? Like we should add namespace in the cs file as needed. That is adding more namespace in the cs file affects performance ? Like using System; using System.Data.Sql; using System.Collections.Generic; using System.Data; using System.IO; using System.Linq; using System.Text.RegularExpressions; using System.Windows.Forms; using System.Xml; using System.Data.SqlClient; using System.ComponentModel;

    Read the article

< Previous Page | 75 76 77 78 79 80 81 82 83 84 85 86  | Next Page >