Search Results

Search found 3559 results on 143 pages for 'winforms interop'.

Page 7/143 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Winforms ComboBox autocomplete search multiple parts of string

    - by studiothat
    Very similar question to this one... http://stackoverflow.com/questions/522521/autocomplete-for-combobox-in-wpf-anywhere-in-text-not-just-beginning but my issue is for windows-forms rather than WPF. I have a winforms databound combox working great with autocomplete list coming from the data items in the combobox. Of course the client wants it to work "better", and that means that they want the autocomplete to work by searching and showing autocomplete options for any matching (contains()) string not just the starting string (startswith()) I know it's probably not just a property that can be set in the combobox, but can anyone point me in the right direction?

    Read the article

  • Hardware Emulator / Simulator for Winforms .Net Application

    - by Suneet
    I have a WinForms .Net HMI software which talks to hardware over USB. I check for communication with the hardware at Load time and if communication is active then run it (The hardware manufacturer has provided a communication library to talk over USB). I want to build an emulator for cases when communication with hardware is not possible (not connected) and want the software to run in simulated mode by providing dummy values for different states of hardware. Has anyone implemented something similar? Any pointers will be helpful. Are there any design patterns to handle such implementations. TIA

    Read the article

  • Using RichTextBox SelectionTabs property in winforms

    - by Bala R
    In a winforms application, I'm using a RichTextBox and I'm trying to reduce the output from a '\t' to 4 spaces from whatever the default is. I have this in the form's OnLoad _richTextBox.Text = "1\t2\t3\t4\t5"; _richTextBox.SelectAll(); _richTextBox.SelectionTabs = new int[] {100,200,300,400 }; I have a breakpoint before and after this snippet. The SelectionTabs is set to {int[0]} (empty int array) before and after the assignment. Can anyone tell me why my assignment is not going through?

    Read the article

  • How to control docking order in C# WinForms

    - by Tommy
    As the title states, I'm looking for a way to control the order in which the items dock to the top of my control. I've played with the windows form designer, and i cant seem to find what the RightClick->Order->SendToFront is doing, because thats exactly what I want to happen. As far as I can get to happen, as I add my contents to my control, the newest contents is always at the top, and I'd like for the Newer contents to be on the bottom, and the oldest contents to be at the top. Summery: Is there an easy way in WinForms (C#), to control the order in which things dock to the sides of controls?

    Read the article

  • Alternative Input Device(Midi) doesn't prevent Screen Saver in Winforms application

    - by DTig
    I have developed a c# winforms application whereby the user is providing input via a midi connected device. The user will go for long periods without using the keyboard or mouse. When I receive a midi message is there anything I can do to "tell" the system that this counts as user activity (ie key press). I don't want the screen saver or time lockouts to occur, if they are actively using the midi device. I think my request is different than other requests I've seen because they want to disable screen savers for the life of their application whereby I just want midi input I receive to count as user interactivity. Is there something I can call when I receive midi input to signify to the system user activity?

    Read the article

  • How to print css applied background images with the winforms webbrowser control

    - by Geir-Tore Lindsve
    I am using the webbrowser control in winforms and discovered now that background images which I apply with css are not included in the printouts. Is there a way to make the webbrowser print the background of the displayed document too? Edit: Since I wanted to do this programatically, I opted for this solution: using Microsoft.Win32; ... RegistryKey regKey = Registry.CurrentUser .OpenSubKey("Software") .OpenSubKey("Microsoft") .OpenSubKey("Internet Explorer") .OpenSubKey("Main"); //Get the current setting so that we can revert it after printjob var defaultValue = regKey.GetValue("Print_Background"); regKey.SetValue("Print_Background", "yes"); //Do the printing //Revert the registry key to the original value regKey.SetValue("Print_Background", defaultValue); Another way to handle this might be to just read the value, and notify the user to adjust this himself before printing. I have to agree that tweaking with the registry like this is not a good practice, so I am open for any suggestions. Thanks for all your feedback

    Read the article

  • Winforms - a strange problem a with simple binding

    - by Adi Barda
    Hi Guys, It's hard for me to clearly describe my problem but I'll try. I have a UserControl1 which contains UserControl2 which contains several WinForms controls (most of them DevExpress). I do simple binding to these controls to my datatable fields. So far everything works fine. When I move the focus to a record in the table (by navigating in a grid rows for example) the binding works great, the concurrenmcy manager moves the cursor and everything reflects right in the bounded controls. The problem starts when I add new user UserControl3 above UserControl2 and make UserControl2.Visible = false. Now UserControl3 is shown and UserControl2 exists but not shown. Now when I set UserControl2.Visible = true to show it again the simple binding stops working! I navigate in the grid but either the ConcurrencyManager stops working or the simple binding becomes disconnected. My question: Are there any known issues/ best practices with the binding & concurrency manager? Thanks a lot, Adi Barda

    Read the article

  • Multi-threading mechanisms to run some lengthy operations from winforms code and communication with

    - by tmarouda
    What do I want to achieve: I want to perform some time consuming operations from my MDI winforms application (C# - .NET). An MDI child form may create the thread with the operation, which may take long time (from 0.1 seconds, to even half hour) to complete. In the meantime I want the UI to respond to user actions, including manipulation of data in some other MDI child form. When the operation completes, the thread should notify the MDI child that the calculations are done, so that the MDI child can perform the post-processing. How can I achieve this: Should I use explicit threading (i.e., create explicit threads), thread pools? Or simply just propose your solution. Should I create foreground or background threads? And how does the thread communicates with the GUI, according the solution you propose? If you know of a working example that handles a similar situation, please make a note.

    Read the article

  • Using IVMRWindowlessControl to display video in a Winforms Control and allow for full screen toggle

    - by Jonathan Websdale
    I've recently switched from using the IVideoWindow interface to IVMRWindowlessControl in my custom Winforms control to display video. The reason for this was to allow zoom capabilities on the video within the control. However in switching over, I've found that the FullScreen mode from IVideoWindow is not available and I am currently trying to replicate this using the SetVideoWindow() method. I'm finding that I size the video in my control to be at the same resolution as the screen however I can't get the control to position itself to the top/left of the screen and become the top most window. Any ideas on how to achieve this since the IVideoWindow::put_FullScreenMode just did it all for you?

    Read the article

  • C# Winforms ADO.NET - DataGridView INSERT starting with null data

    - by Geo Ego
    I have a C# Winforms app that is connecting to a SQL Server 2005 database. The form I am currently working on allows a user to enter a large amount of different types of data into various textboxes, comboboxes, and a DataGridView to insert into the database. It all represents one particular type of machine, and the data is spread out over about nine tables. The problem I have is that my DataGridView represents a type of data that may or may not be added to the database. Thus, when the DataGridView is created, it is empty and not databound, and so data cannot be entered. My question is, should I create the table with hard-coded field names representing the way that the data looks in the database, or is there a way to simply have the column names populate with no data so that the user can enter it if they like? I don't like the idea of hard-coding them in case there is a change in the database schema, but I'm not sure how else to deal with this problem.

    Read the article

  • Winforms control that works like ajax tag-completion

    - by Sargola
    Heya, I want to create a winforms app where you can assign tags to an entity. ofc I want the customer to re-use existing tags a lot. That's why I want to show them the list of tags while they are typing (similar to intellisense in VS and the tags-dropdown even here in stackoverflow ;)) do you have any control(s) in mind that offers this functionality? can I reuse a ComboBox for this? (here I need to drop it down programatically - how?) I want to have the taglist getting input-focus but not lose the mainform-focus, and I want it to be on top over all windows and even range out of the mainform-area (like intellisense in vs) thx!

    Read the article

  • How to force user to user Administrator account in WinForms

    - by Smejda
    I have simple WinForms application where modifying Windows Registry. The problem is that in Vista / Windows 7 I need to force user to switch to administrator. I do not want to force user to Run as Administrator form start of the application. I want him to do it when there is necessity to write to registry. Best case scenario would be to reach exacly the same message which appear in lot's of Setups, when user need to 'switch' to Administrator so there is no necessity to Run as Administrator form beginning. How I can achieve this in .Net ?

    Read the article

  • WPF exception handling when launched from WinForms

    - by Sonic Soul
    so i came across this interesting article on WPF exception handling: http://srtsolutions.com/public/item/251263 it works by declaring DispatcherUnhandledException handler in xaml <application> node. but what if a WPF window is launched from win forms application? where can i declare a general exception handler? The problem is that when WPF crashes, it brings down the whole WinForms app with it. *Edit what if instead of launching the WPF window directly, i launched an "Application" which than defined a start window?? is that possible/advisable?

    Read the article

  • WinForms app config manager is x86 and cannot reference assemblies that targets Any CPU

    - by ivos
    Hi I'm using Win7 64x and Visual Studio 2010. I created a library/framework targeting Any CPU. Then I created a new WinForms project that uses that framework, leaving the default values of the wizard. I mean, I didn't change anything. When I reference my framework, VS cannot find the assemblies. If I go to the project properties, it is targeting Any CPU (as expected, I can change it if I want). But if I go to Configuration Manager, the only choice I have for that project is x86. And I guess that is the problem. I tried to add Any CPU as a new Target but I was unable to. Could someone help me? :) Thanks in advance!

    Read the article

  • Winforms panel event after scroll

    - by Charlie boy
    Hello I have a panel in wich I do a bounch af rater complex drawing in the paint event. Since the drawing-code is kind of heavy, it gets rather twitchy when I scroll the panel, since the paint event is raised in such short intervals. My question is really this; Can i capture evnts such as "on scroll start" and "on scroll end" on a winforms control? If so, I could then just pause the drawing-code until the scroll is complete. Thanks in advance!

    Read the article

  • Abstract Forms using WinForms

    - by pm_2
    I’m trying to achieve a similar affect in a WinForms application as a master form does with ASP.NET. My initial thoughts on this were to create a base form and declare it as abstract, but the compiler doesn’t seem to let me do this. public abstract partial class Master : Form { public Master() { InitializeComponent(); } } So I have two questions: Why will the compiler not let me do this? Am I using the wrong syntax or is this a genuine restriction. Can anyone suggest a workaround or better way to do this? EDIT: InitializeComponent code: private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.mainMenu1 = new System.Windows.Forms.MainMenu(); this.Menu = this.mainMenu1; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.Text = "Master"; this.AutoScroll = true; }

    Read the article

  • c# WinForms ReportViewer Performance issue using RefreshReport() and ServerReport.SetParameters()

    - by mdk
    Hi All, Currently I am writing a c# client application that uses the WinForms ReportViewer Control to display reports from a remote server. I am having performance troubles with the ReportViewer Control, to be specific with the 2 methods reportViewer.ServerReport.SetParameters() and reportViewer.RefreshReport() – they both take a really long time to complete and not just on the very first call, but on each subsequent call as well. SetParameters() takes 20 to 40 seconds (they vary greatly in time, some execute event okay fast) and RefreshReport() is a bit faster but still takes ages. I don’t think the server is the culprit, as the same report viewed using the browser renders pretty fast, about a second tops. The report in question doesn't matter as well. When I break into the process and take a look at the call stack, I see a call to Socket.DoConnect. So I thought that’s a good reason to start using fiddler and I installed it, disabled caching and fired up the app again to see which call takes that long to connect, but the performance issue was gone. By using a proxy I am having the same performance as the webbrowser. FYI: I am using NTLM authentication in the following way: reportViewer.ServerReport.ReportServerCredentials.NetworkCredentials = new NetworkCredentials() { Username = ... } I don’t have a strong webbackground, so I guess my question is: What should this tell me / What should I be looking into? (Btw: Adding fiddler to my installation package is not the solution I am looking for :)) I am grateful for any pointers. Take care, -Martin

    Read the article

  • WinForms ComboBox DropDown and Autocomplete window both appear

    - by Clyde
    I've got a combobox on a winforms app with this code: comboBox1.AutoCompleteMode = AutoCompleteMode.SuggestAppend; comboBox1.AutoCompleteSource = AutoCompleteSource.ListItems; DataTable t = new DataTable(); t.Columns.Add("ID", typeof(int)); t.Columns.Add("Display", typeof(string)); for (int i = 1; i < 2000; i++) { t.Rows.Add(i, i.ToString("N0")); } comboBox1.DataSource = t; comboBox1.ValueMember = "ID"; comboBox1.DisplayMember = "Display"; I then follow these steps when the window opens: Click the combobox drop down button -- this displays the list of items and selects the text in the combobox Type '5', '1' ... i.e. I'm looking to use autocomplete to search for 515, 516, etc. You'll see that the autocomplete window now appears ON TOP of the drop down list. However if I mouse over, it's the obscured drop down window behind the autocomplete window that's receiving the mouse events, including the click. So I think I'm clicking on an autocomplete item but actually clicking on something totally random that I can't see. Is this a bug in the ComboBox? I'm using Windows 7 if that matters. Am I configuring the ComboBox wrong somehow? Note also that using the KEYBOARD uses the autocomplete drop down. So up/down arrow keys are using the front window, but the mouse is using the back window.

    Read the article

  • Structuring projects & dependencies of large winforms applications in C#

    - by Benjol
    UPDATE: This is one of my most-visited questions, and yet I still haven't really found a satisfactory solution for my project. One idea I read in an answer to another question is to create a tool which can build solutions 'on the fly' for projects that you pick from a list. I have yet to try that though. How do you structure a very large application? Multiple smallish projects/assemblies in one big solution? A few big projects? One solution per project? And how do you manage dependencies in the case where you don't have one solution. Note: I'm looking for advice based on experience, not answers you found on Google (I can do that myself). I'm currently working on an application which has upward of 80 dlls, each in its own solution. Managing the dependencies is almost a full time job. There is a custom in-house 'source control' with added functionality for copying dependency dlls all over the place. Seems like a sub-optimum solution to me, but is there a better way? Working on a solution with 80 projects would be pretty rough in practice, I fear. (Context: winforms, not web) EDIT: (If you think this is a different question, leave me a comment) It seems to me that there are interdependencies between: Project/Solution structure for an application Folder/File structure Branch structure for source control (if you use branching) But I have great difficulty separating these out to consider them individually, if that is even possible. I have asked another related question here.

    Read the article

  • weird result with c# winForms array of Lists

    - by jello
    so I'm trying to store values in an array of Lists in C# winForms. In the for loop in which I make the sql statment, everything works fine: the message box outputs a different medication name each time. for (int i = 0; i < numberOfMeds; i++) { queryStr = "select * from biological where medication_name = '" + med_names[i] + "' and patient_id = " + patientID.patient_id; using (var conn = new SqlConnection(connStr)) using (var cmd = new SqlCommand(queryStr, conn)) { conn.Open(); using (SqlDataReader rdr = cmd.ExecuteReader()) { while (rdr.Read()) { medObject.medication_date = (DateTime)rdr["patient_history_date_bio"]; medObject.medication_name = rdr["medication_name"].ToString(); medObject.medication_dose = Convert.ToInt32(rdr["medication_dose"]); medsList[i].Add(medObject); } } conn.Close(); MedicationTimelineClass medObjectx = medsList[i][0] as MedicationTimelineClass; MessageBox.Show(medObjectx.medication_name); } } but then, when I take the message box code out of the loop, meaning that the array of Lists is supposed to be populated, I always get the same value: the last value entered. the same medication name, no matter what number I put between those brackets. It's like if the whole array of Lists is populated with the same data. for (int i = 0; i < numberOfMeds; i++) { queryStr = "select * from biological where medication_name = '" + med_names[i] + "' and patient_id = " + patientID.patient_id; using (var conn = new SqlConnection(connStr)) using (var cmd = new SqlCommand(queryStr, conn)) { conn.Open(); using (SqlDataReader rdr = cmd.ExecuteReader()) { while (rdr.Read()) { medObject.medication_date = (DateTime)rdr["patient_history_date_bio"]; medObject.medication_name = rdr["medication_name"].ToString(); medObject.medication_dose = Convert.ToInt32(rdr["medication_dose"]); medsList[i].Add(medObject); } } conn.Close(); } } MedicationTimelineClass medObjectx = medsList[0][0] as MedicationTimelineClass; MessageBox.Show(medObjectx.medication_name); what's going on here?

    Read the article

  • C# - WinForms - Exception Handling for Events

    - by JustLooking
    Hi all, I apologize if this is a simple question (my Google-Fu may be bad today). Imagine this WinForms application, that has this type of design: Main application - shows one dialog - that 1st dialog can show another dialog. Both of the dialogs have OK/Cancel buttons (data entry). I'm trying to figure out some type of global exception handling, along the lines of Application.ThreadException. What I mean is: Each of the dialogs will have a few event handlers. The 2nd dialog may have: private void ComboBox_SelectedIndexChanged(object sender, EventArgs e) { try { AllSelectedIndexChangedCodeInThisFunction(); } catch(Exception ex) { btnOK.enabled = false; // Bad things, let's not let them save // log stuff, and other good things } } Really, all the event handlers in this dialog should be handled in this way. It's an exceptional-case, so I just want to log all the pertinent information, show a message, and disable the okay button for that dialog. But, I want to avoid a try/catch in each event handler (if I could). A draw-back of all these try/catch's is this: private void someFunction() { // If an exception occurs in SelectedIndexChanged, // it doesn't propagate to this function combobox.selectedIndex = 3; } I don't believe that Application.ThreadException is a solution, because I don't want the exception to fall all the way-back to the 1st dialog and then the main app. I don't want to close the app down, I just want to log it, display a message, and let them cancel out of the dialog. They can decide what to do from there (maybe go somewhere else in the app). Basically, a "global handler" in between the 1st dialog and the 2nd (and then, I suppose, another "global handler" in between the main app and the 1st dialog). Thanks.

    Read the article

  • Databinding in WinForms performing async data import

    - by burnside
    I have a scenario where I have a collection of objects bound to a datagrid in winforms. If a user drags and drops an item on to the grid, I need to add a placeholder row into the grid and kick off a lengthy async import process. I need to communicate the status of the async import process back to the UI, updating the row in the grid and have the UI remain responsive to allow the user to edit the other rows. What's the best practice for doing this? My current solution is: binding a thread safe implementation of BindingList to the grid, filled with the objects that are displayed as rows in the grid. When a user drags and drops an item on to the grid, I create a new object containing the sparse info obtained from the dropped item and add that to the BindingList, disabling the editing of that row. I then fire off a separate thread to do the import, passing it the newly bound object I have just created to fill with data. The import process, periodically sets the status of the object and fires an event which is subscribed to by the UI telling it to refresh the grid to see the new properties on the object. Should I be passing the same object that is bound to the grid to the import process thread to operate on, or should I be creating a copy and merging back the changes to the object on the UI thread using BeginInvoke? Any problems or advice with this implementation? Thanks

    Read the article

  • Accounting System for Winforms / SQL Server applications

    - by Craig L
    If you were going to write a vertical market C# / WinForms / SQL Server application and needed an accounting "engine" for it, what software package would you chose ? By vertical market, I mean the application is intended to solve a particular set of business problems, not be a generic accounting application. Thus the value add of the program is the 70% of non-accounting related functionality present in the finished product. The 30% of accounting functionality is merely to enable the basic accounting needs of the business. I said all that to lead up to this: The accounting engine needs to be a royalty-free runtime license and not super expensive. I've found a couple C#/SQL Server accounting apps that can be had with source code and a royalty free run time for $150k+ and that would be fine for greenfield development funded by a large bankroll, but for smaller apps, that sort of capital outlay isn't feasible. Something along the lines of $5k to $15k for a royalty-free runtime would be more reasonable. Open-source would be even better. By accounting engine, I mean something that takes care of at a minimum: General Ledger Invoices Statements Accounts Receivable Payments / Credits Basically, an accounting engine should be something that lets the developer concentrate on the value added (industry specific business best practices / processes) part of the solution and not have to worry about how to implement the low level details of a double entry accounting system. Ideally, the accounting engine would be something that is licensed on a royalty free run-time basis. Suggestions, please ?

    Read the article

  • WinForms Load Event / Static Initialization Strangeness

    - by Eric J.
    Background I'm troubleshooting an WinForms 2.0 program that's already been burned to CD for distribution to an internet-challenged target audience. Some users are experiencing a fatal error that I can reproduce locally. Reproducing the Error I get the fatal error when I log into my Vista box using a standard user that I just created, even if I run the program as administrator. I do not get the fatal error when I log in as local administrator. I'm not sure that being administrator is necessarily the trigger (since runas did not help). I have reproduced this half a dozen times under each account with consistent results. The faulty code Base.cs (base class for several user controls, only one of which is shown on first screen) private void BaseWindow_Load(object sender, EventArgs e) { // This message shown once in both cases MessageBox.Show("BaseWindow_Load for " + this.GetType().FullName); SkinManager.ApplySkin(this); } SkinManager.cs private static Skin skin = null; public static void ApplySkin(UserControl applyTo) { if (skin == null) { skin = new Skin(SkinsDirectory, "Default"); } } Skin.cs internal Skin(string skinPath, string skinName) { config = SkinConfig.Load(path); } SkinConfig.cs public static SkinConfig Load(string path) { // This message shown only once running as Admin but twice running as standard user System.Windows.Forms.MessageBox.Show("@1"); // !!! LOCK path HERE !!! } A user control loads on the first form, which triggers a call to SkinManager.ApplySkin, which checks if skin is null and, if so assigns it (without thread synchronization or recursion protection), which ultimately causes a file to be opened. When logged in as local admin, that sequence completes just fine. When logged in as my test standard user, ApplySkin is always called a second time while skin is still null, causing a second attempt to load, causing the file to be locked on the second attempt. The error handling is draconian at this point and the program terminates. The Question While this code can be easily fixed, I would like to understand why the error is happening only in some cases.

    Read the article

  • WinForms data binding with a Save button?

    - by Mat
    How is data binding in C# WinForms supposed to work when you have a Save button? I don't want the data updated until I press Save! I have two forms (list and detail) backed by a BindingList<T> collection and my custom object from that collection, respectively. I can bind each form to the list or object appropriately. However, any changes made in the detail form are immediately reflected in the list form - I don't want to save the changes and update the details shown in the list until the Save button is pressed. Is data binding designed to support this? Is there a common pattern for doing so? Whichever way I look at it, binding doesn't seem to be able to support this scenario. I've considered the following: Pass a clone of the object to the detail form, but then I have to reconcile the changes on Save - changes may have been made to the copy in the list in the meantime. Implementing IEditableObject and calling EndEdit on save almost works as I can prevent the list being notified of the changes made until Save is pressed, but if something else causes a refresh the list is updated with the interim data. I'm currently left with dispensing with data binding in my detail view, and doing it all manually. Which is rather annoying.

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >