Search Results

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

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

  • Exception in the OnIdle event does not bubble up

    - by sthay
    On my main form, I subscribed to two events: Application.ThreadException and Application.Idle. In theory, any exception that is not caught should get bubbled up to the main form. However, this does not work if the exception happens in the OnIdle event. The system just crashes. Does anyone know how to solve this problem? Thanks so much.

    Read the article

  • Crystal Report | Printing | Default Printer

    - by Akshay J
    I am making one application where user will print invoices which I am displaying using Crystal Report. The user showed me his current application made using ForPro. In that application, under Printer Options form, one can see all the printers currently installed and the user could select default printer. When the invoice is made, the user presses the print button, then there is one dialog asking for no. of copies. When it's entered, the invoice gets printed directly, without any Print Dialog Box. If the user wants to change the printer again he/she will change it in the Printer Option form. I want to know if similar thing is possible in Crystal Report and need guidance on how to approach for it.

    Read the article

  • Infinite loop when Select?!

    - 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... any idea why?

    Read the article

  • How to assign a numbering scheme to TreeNodes based on position

    - by TChristian
    I have a TreeView control in a Windows Forms application that is displaying my own subclass of TreeNode. I need to display a number along with each node's text indicating its position in the tree, like 1 for the root, 1.1 for its first child, 1.2 for its second child, etc. I'm using C# with .NET 2.0 The best that I can come up with is, after the tree is built, go to each node, recursively find the parent and append the parent's sibling number to the front of the node's text until you reach the root.

    Read the article

  • How do I get a list of all languages that my Windows Forms application has been localized to?

    - by Andrei B
    I have localized localized a Form into two language by setting the Localizable property to True and setting the Language from (Default) to (Dutch(Netherlands)), and I changed the control texts. Visual Studio generated the resource files and compiles them into the application. I need to get a simple list of all the languages that my form has been localized into. Currently it would be just two English and Dutch, but more may come. I need to programatically get a list of "what languages my application is localized into". Do I look into the resource files or use ResourceManager or what? Thanks!

    Read the article

  • How to check if a thread is busy in C#?

    - by Sam
    I have a Windows Forms UI running on a thread, Thread1. I have another thread, Thread2, that gets tons of data via external events that needs to update the Windows UI. (It actually updates multiple UI threads.) I have a third thread, Thread3, that I use as a buffer thread between Thread1 and Thread2 so that Thread2 can continue to update other threads (via the same method). My buffer thread, Thread3, looks like this: public class ThreadBuffer { public ThreadBuffer(frmUI form, CustomArgs e) { form.Invoke((MethodInvoker)delegate { form.UpdateUI(e); }); } } What I would like to do is for my ThreadBuffer to check whether my form is currently busy doing previous updates. If it is, I'd like for it to wait until it frees up and then invoke the UpdateUI(e). I was thinking about either: a) //PseudoCode while(form==busy) { // Do nothing; } form.Invoke((MethodInvoker)delegate { form.UpdateUI(e); }); How would I check the form==busy? Also, I am not sure that this is a good approach. b) Create an event in form1 that will notify the ThreadBuffer that it is ready to process. // psuedocode List<CustomArgs> elist = new List<CustomArgs>(); public ThreadBuffer(frmUI form, CustomArgs e) { from.OnFreedUp += from_OnFreedUp(); elist.Add(e); } private form_OnFreedUp() { if (elist.count == 0) return; form.Invoke((MethodInvoker)delegate { form.UpdateUI(elist[0]); }); elist.Remove(elist[0]); } In this case, how would I write an event that will notify that the form is free? and c) an other ideas?

    Read the article

  • Method to register method to be called when event is raised

    - by zaidwaqi
    I have a Panel which contains 20 PictureBox controls. If a user clicks on any of the controls, I want a method within the Panel to be called. How do I do this? public class MyPanel : Panel { public MyPanel() { for(int i = 0; i < 20; i++) { Controls.Add(new PictureBox()); } } // DOESN'T WORK. // function to register functions to be called if the pictureboxes are clicked. public void RegisterFunction( <function pointer> func ) { foreach ( Control c in Controls ) { c.Click += new EventHandler( func ); } } } How do I implement RegisterFunction()? Also, if there are cool C# features that can make the code more elegant, please share.

    Read the article

  • Is there a way to remove Alt-character shortcuts from controls at runtime?

    - by Dan Neely
    I have a dialog with a number of Alt-Letter shortcuts on labels for textboxes/etc. This dialog can present data in either an editable or a read-only mode. I've received a request to hide the underlines for the shortcuts if the dialog is in read only mode. Other than editing the label text at runtime (ugh) is there any way to remove them? If you don't know what I'm referring to by alt-Letter shortcuts see this question.

    Read the article

  • How to customize file dialog in wpf

    - by ManjuAnoop
    In Windows7 I am using a customized Open File Dialog( WPF application). My Open File dialog is derived from Microsoft.Win32.CommonDialog. The dialog have old look, how to change this to new look (windows7 file dialog look(Explorer style)). Code portion: private const int OFN_ENABLESIZING = 0x00800000; private const int OFN_EXPLORER = 0x00080000; private const int OFN_ENABLEHOOK = 0x00000020; protected override bool RunDialog(IntPtr hwndOwner) { OPENFILENAME_I.WndProc proc = new OPENFILENAME_I.WndProc(this.HookProc); OPENFILENAME_I ofn = new OPENFILENAME_I(); this._charBuffer = CharBuffer.CreateBuffer(0x2000); if (this._fileNames != null) { this._charBuffer.PutString(this._fileNames[0]); } ofn.lStructSize = Marshal.SizeOf(typeof(OPENFILENAME_I)); ofn.hwndOwner = hwndOwner; ofn.hInstance = IntPtr.Zero; ofn.lpstrFilter = MakeFilterString(this._filter, this.DereferenceLinks); ofn.nFilterIndex = this._filterIndex; ofn.lpstrFile = this._charBuffer.AllocCoTaskMem(); ofn.nMaxFile = this._charBuffer.Length; ofn.lpstrInitialDir = this._initialDirectory; ofn.lpstrTitle = this._title; ofn.Flags = OFN_EXPLORER | OFN_ENABLESIZING | OFN_ENABLEHOOK; ofn.lpfnHook = proc; ofn.FlagsEx = 0x1000000 ; NativeMethods.GetOpenFileName(ofn); // } [SecurityCritical, SuppressUnmanagedCodeSecurity, DllImport("comdlg32.dll", CharSet = CharSet.Unicode, SetLastError = true)] internal static extern bool GetOpenFileName([In, Out] OPENFILENAME_I ofn);

    Read the article

  • how to adjust sliding of scroll according to the value calculated by me?

    - by cng
    I am working on scroll. I have made a program wherein if the scroll box is in particular range of the panel then it automatically moves to a particular position in the slider. For eg, I have a panel of size 500. the scroll has height of 100. Now the total intervals are 5. Now if i slide the scroll box at a position 225 then i want that it automatically slides to the start of that interval that is at position 200. or if i slide to position 450 then instead of staying there it goes to position 400. Is it possible?

    Read the article

  • What be the regex to determine whether there is date in the string or not with different date format

    - by Harikrishna
    I am parsing table information from the html table.Now I want to check whether there is date in the records for one particular column.Means I want to check whether there is date in the string or not .And date can be in different format like the string can be FUTIDX 26FEB2009 NIFTY 0 -- There is date in the string. FUTIDX MINIFTY 30 Jul 2009 -- There is date in the string. FUTSTK ONGC 27 Mar 2008 -- There is date in the string. What should be the regular expression for that ?

    Read the article

  • For which substring of the string1 matches occurred with the string2.

    - by Harikrishna
    I want to know that in particular string1 for which substring of the string1 the string2 matches.Like String str1="Order Number Order Time Trade Number"; String str2="Order Tm"; string regex = Regex.Escape(str2.Replace(@"\ ", @"\s*"); bool isColumnNameMatched = Regex.IsMatch(str1, regex, RegexOptions.IgnoreCase); I am using regex because "Order Tm" will also matches "Order Time".It gives bool value that matches occurred or not. But if it str2 is in str1 then I want to know at which position in the str1 the str2 matches. Like str2="Order Tm" then something like that returns the string which is matched with str2 in the str1.Here str2="Order Tm" then it should return like in the str1,Order Time is the substring where matches is occurred.

    Read the article

  • c# - sqllite dosnt save data i inserted

    - by samy
    I'm messing around with SQL lite and learning it. I got a table called People, I got some method that connect to the database and do some stuff, like show all the info. Now I'm trying to insert some data and here it get wierd for me. I have this method: private void ExecuteQuery(string txtQuery) { SetConnection(); sql_con.Open(); sql_cmd = sql_con.CreateCommand(); sql_cmd.CommandText = txtQuery; sql_cmd.ExecuteNonQuery(); sql_con.Close(); } and to see all the data I've got this method: private void LoadData() { SetConnection(); sql_con.Open(); sql_cmd = sql_con.CreateCommand(); string CommandText = "SELECT * FROM People"; DB = new SQLiteDataAdapter(CommandText, sql_con); DS.Reset(); DB.Fill(DS); DT = DS.Tables[0]; dataGridView1.DataSource = DT; sql_con.Close(); } When I inset some data and right afther it I call the LoadData(), I can see all the changes I made. After I close the program, and then open it agian and call LoadData(), I don't see the new info that I inserted before. I got some data that I used SQL lite GUI app to insert, and I can see that data every time I call the LoadData() method, but not mine. Do I need to do somthing else to make sure SQL lite saves all the data?

    Read the article

  • Treeview remove property problem

    - by curiosity
    Hi, i added a SampleNode to the treeview. if i remove any node from SampleNode, like, TreeNode[] nodes = this.SampleNode.Nodes.Find(node.Text, true); if (nodes.Length > 0) { int j = nodes[0].Index; if (nodes.Length > 0) this.SampleNode.Nodes[j].Remove(); } it is deleted in treeview but not in SampleNode. Why does this happens? what is the solution?

    Read the article

  • Casting error in my form

    - by Siva
    I have a ComboBox in a DataGridView. However I get an error when I run it: Unable to cast object of type 'System.Windows.Forms.DataGridView' to type 'System.Windows.Forms.ComboBox'. What can I do to resolve this error? ComboBox comboBox; private void dataGridView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e) { if (e.Control is ComboBox) { comboBox = e.Control as ComboBox; if (dataGridView1.CurrentCell.ColumnIndex >= 0) { System.Diagnostics.Debug.WriteLine("Edit Control Showing"); comboBox.SelectedIndexChanged -= new EventHandler(comboBoxItems_SelectedIndexChanged); comboBox.SelectedIndexChanged += new EventHandler(comboBoxItems_SelectedIndexChanged); } } } void comboBoxItems_SelectedIndexChanged(object sender, EventArgs e) { try { int comboBoxSelectedIndex = ((ComboBox)sender).SelectedIndex; string comboboxSelectedValue = ((ComboBox)sender).SelectedText; int gridViewSelectedRow = dataGridView1.CurrentRow.Index; if (comboBoxSelectedIndex >= 0 && gridViewSelectedRow >= 0) { System.Diagnostics.Debug.WriteLine("ComboBox Index - " + comboBoxSelectedIndex); System.Diagnostics.Debug.WriteLine("GridView Index - " + gridViewSelectedRow); if (comboBox != null) { comboBox.SelectedIndexChanged -= new EventHandler(comboBoxItems_SelectedIndexChanged); } } } catch(Exception E) { } }

    Read the article

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