Search Results

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

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

  • Should I share UI for objects that use common fields?

    - by wb
    I have a parent class that holds all of the fields that are common between all device types. From that, I have a few derived classes that each hold their unique fields. Say I have device type "Switch" and "Transformer". Both derived classes only have 2-3 of their own unique fields. When doing the UI design (windows forms) in this case. Should I create two separate forms for each device type or create a user control with all fields that are shared among all devices? Thank you.

    Read the article

  • Do not want Form to display over other application windows

    - by Cat
    I am displaying a Form from one process by passing the Show method a window handle from another process. I only want this new Form to display above the passed Form, like a MessageBox. However, this newly launched Form appears above other application windows, despite: Setting Process.WindowStyle.Hidden to the Form-displaying process Overriding the ShowWithoutActivation and CreateParams properties of the Form. Making sure Form.TopMost is not true I have checked that the window handle is valid from the second process. Focus is not stolen, however. Process A: Pass (Form) window handle to a new Process B via the command line Process B: Display a new Form using Form.Show(anotherProcessWindowHandle)

    Read the article

  • .NET grouping forms so that pulling up the primary form shows all other forms?

    - by toasteroven
    I have an app that can open up some other forms at the user's request, and they're set to not show in the taskbar. The problem is, if one of the secondary windows becomes hidden by another app, switching to the primary window only brings that form to the forefront. Is there a good way to "group" the forms so that giving any of them focus brings the whole group to the front? I tried calling BringToFront() on each form in the primary form's Activated event, but that also gives the secondary forms focus, making it impossible to interact with the primary form.

    Read the article

  • What do C# Table Adapters actually return?

    - by Raven Dreamer
    I'm working on an application that manipulates SQL tables in a windows form application. Up until now, I've only been using the pre-generated Fill queries, and self-made update and delete queries (which return nothing). I am interested in storing the value of a single value from a single column (an 'nchar(15)' name), and though I have easily written the SQL code to return that value to the application, I have no idea what it will be returned as. SELECT [Contact First Name] FROM ContactSkillSet WHERE [Contact ID] = @CurrentID Can the result be stored directly as a string? Do I need to cast it? Invoke a toString method?

    Read the article

  • Delay in for loop while playing mp3 file C#

    - by daniyalahmad
    I want to give delay in for loop, While in for loop there is mp3 file is playing. What I actually want to do, that every clip plays after 2 sec. There are total 10 clips. Here is my code for (int i=1; i < 10; i++) { System.Threading.Thread.Sleep(1000); WMPLib.WindowsMediaPlayer wplayer = new WMPLib.WindowsMediaPlayer(); wplayer.URL = @"D:\Project C#\A-Z\" + i + ".mp3"; }

    Read the article

  • Spell check in c#

    - by j-t-s
    Hi all 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. Thank you :)

    Read the article

  • Preventing the "[YourProgramName] has stopped working" dialog on unhandled exceptions.

    - by Serapth
    I have a WinForm application, with some dependencies on an external library that can on occasion cause an exception outside of the running threads context. As it stands now, this is completely OK behavior ( well, except of course the exception ) and we wired up AppDomain.CurrentDomain.UnhandledException to simply restart the program. The only problem is, the [Your Program] has stopped working like the one below, appears: Is there a way to prevent this dialog from appearing at all, be it in the AppDomain unhandled exception handler or in a config setting, as no end users are going to be reading it and it just holds up resources until it is clicked.

    Read the article

  • Check Form for child Forms - C#

    - by dimanyuk
    I have main form and some other forms, that can be shown by controls, using ShowDialog(control). Also I have event handler on the main form, that can be handled anytime. How can I check inside it, is there any other dialog forms?

    Read the article

  • selected area to cut an image

    - by Oskar Marciniak
    Hi I would do the selected area to cut an image on picturebox control. I have the following code: using System; using System.Drawing; using System.Windows.Forms; namespace WindowsFormsApplication1 { public partial class Form1 : Form { private Rectangle rect; private Pen p; public Form1() { InitializeComponent(); } private void pictureBox1_Paint(object sender, PaintEventArgs e) { if (this.p == null) this.p = new Pen(Color.FromArgb(100, 200, 200, 200), 5); if (this.rect.Width > 0) e.Graphics.DrawRectangle(this.p, this.rect); } private void pictureBox1_MouseUp(object sender, MouseEventArgs e) { if (e.X < this.rect.X) { this.rect.Width = this.rect.X - e.X; this.rect.X = e.X; } else { this.rect.Width = e.X - this.rect.X; } if (e.Y < this.rect.Y) { this.rect.Height = this.rect.Y - e.Y; this.rect.Y = e.Y; } else { this.rect.Height = e.Y - this.rect.Y; } this.Invalidate(this.rect); } private void pictureBox1_MouseDown(object sender, MouseEventArgs e) { this.rect.X = e.X; this.rect.Y = e.Y; } } } It returns an error here: Application.Run(new Form1()); Why? thanks for all replies ;p

    Read the article

  • .Net forms - intercepting the Close X event.

    - by Hamish Grubijan
    Hi, this must be a dumb question, but I cannot figure it out. I also cannot use the designer because coders before me managed to throw GUI and logic all in one, so now it is confused. I've got to do it the old school way. I have a Form which can be closed in 3 ways: Close button, File / Close menu, and the X icon. I want them all to do the same thing. Intercepting the button and the menu events is easy. In fact, both are hooked up to an onCloseConfig method. Btw, is there a better name for this method? private void onCloseConfig(object sender, System.EventArgs e) { if (! m_configControl.Modified) { Application.Exit(); // Or should it be this.Close(); } .... // Else present a dialog, ask if they want to save. } So, to intercept the X I tried: this.FormClosing +=new FormClosingEventHandler(this.onCloseConfig); I believe this is what causes an infinite loop. I do not want that :) FormClosed is another option, but it seems too late. I just want to intercept the fact that the X was clicked, not the fact that the form is closing. Please help. Thanks!

    Read the article

  • POP3 Transmission Process

    - by j-t-s
    Hi All I was wondering if anyone could help me out (not with code, although that would be appreciated), with the logic behind checking and retrieving messages from a POP3 mail server. I.e. Establish connection Validate credentials Enumerate message list Check each message to see if it's "new" Download "new" message(s). Would this be the correct way about doing this? Thank you

    Read the article

  • How do i set this window to topmost?

    - by acidzombie24
    How do i set my window above all other? I need a bad but noticeable msg box that closes on its own. Msg is a dummy form which is empty. All i want is its title. The problems with the code is the window isnt created 0,0 (its just whereever windows feels like putting it). The width is correct but i notice if i click firefox or another app window my app doesnt pop up. I know it is being shown bc i can see it in the taskbar at the bottom for a brief second. So the bugs so far Doesnt go topmost if i click another app Isnt 0,0 How do i fix this? { var msg = new Msg(); msg.Text = (has ? "*" : "+") + args[0]; msg.TopMost = true; msg.Width = 2000; msg.Top = 0; msg.Left = 0; msg.Show(); System.Threading.Thread.Sleep(1000); msg.Close(); }

    Read the article

  • Import external dll based on 64bit or 32bit OS

    - by Mike_G
    I have a dll that comes in both 32bit and 64bit version. My .NET WinForm is configured for "Any CPU" and my boss will not let us have separate installs for the different OS versions. So I am wondering: if I package both dlls in the install, then is there a way to have the WinForm determine if its 64bit/32bit and load the proper dll. I found this article for determining version. But i am not sure how to inject the proper way to define the DLLImport attribute on the methods i wish to use. Any ideas?

    Read the article

  • My.Settings not saving after install

    - by blancaster
    My application is not saving users settings after I install it. When I test my app in debug or release mode it works fine. However after compiling, linking and installing the My.Settings.Save() does not seem to be working. I can manually change a setting in the config file and the app runs accordingly. So I know it’s reading the config file on application startup. What am I doing wrong? Thanks

    Read the article

  • Encapsulating a Windows.Forms.Button

    - by devoured elysium
    I want to define a special kind of button that only allows two possible labels: "ON" and "OFF". I decided to inherit from a Windows.Forms.Button to implement this but now I don't know I how should enforce this rule. Should I just override the Text property like this? public override string Text { set { throw new InvalidOperationException("Invalid operation on StartStopButton!"); } } The problem I see with this is that I am breaking the contract that all buttons should have. If any code tries something like foreach (Button button in myForm) { button.Text = "123"; } they will get an Exception if I have any of my special buttons on the form, which is something that isn't expectable. First, because people think of properties just as "public" variables, not methods, second, because they are used to using and setting whatever they want to buttons without having to worry with Exceptions. Should I instead just make the set property do nothing? That could also lead to awkward results: myButton.Text = "abc"; MessageBox.Show(abc); //not "abc"! The general idea from the OO world is to in this kind of cases use Composition instead of inheritance. public class MySpecialButton : <Some class from System.Windows.Forms that already knows how to draw itself on forms> private Button button = new Button(); //I'd just draw this button on this class //and I'd then only show the fields I consider //relevant to the outside world. ... } But to make the Button "live" on a form it must inherit from some special class. I've looked on Control, but it seems to already have the Text property defined. I guess the ideal situation would be to inherit from some kind of class that wouldn't even have the Text property defined, but that'd have position, size, etc properties available. Upper in the hierarchy, after Control, we have Component, but that looks like a really raw class. Any clue about how to achieve this? I know this was a long post :( Thanks

    Read the article

  • Multithreaded Applications

    - by j-t-s
    Hi All I have been reading the articles on MSDN, but my mind is dead (this usually happens when I read MSDN (No offense MSDN, but your articles confuse me at times.)), and I'm trying to do some "background work" in may app, but not sure how. It's just a single method. But the application hangs, and I have to wait up to 1 - 3 minutes for it to become ...unhanged? Are there any simple examples that are laying 'roun online somewhere that I can have a look at/play around with? Thank you all

    Read the article

  • Have anyone ever create/manipulate a table application from the ground up/scratch?

    - by Darwin
    Have anyone ever create/manipulate a table application from the ground up/scratch? I want to create a table using flash AS 3. I like to have the features like to the MS Studio Web Developer option. The options are create a table, merge cells, split cell, resize columns, delete cell, delete row, delete column etc... I think this is going to be very complicated thing to do. I think the only way to do it is to build it from the ground up because I don’t think Flash has the library/component for it. I was able to create rows and columns by creating the # of rectangles listed it from the left to the right and move the next coordinate for the next row. Now the most challenging this is to manipulate it. This is the must have feature on my website and we don’t want use Javascript to create table on the server side to create the table.

    Read the article

  • How can i add to dataGridView1 a data to the last row/column?

    - by user3681442
    In top of form1 i did: private System.Timers.Timer _refreshTimer; private int _thisProcess; Then in the Form1 Load event: _thisProcess = Process.GetCurrentProcess().Id; InitializeRefreshTimer(); PopulateApplications(); Then the timer init method: void InitializeRefreshTimer() { _refreshTimer = new System.Timers.Timer(5000); _refreshTimer.SynchronizingObject = this; _refreshTimer.Elapsed += new System.Timers.ElapsedEventHandler(TimerToUpdate_Elapsed); _refreshTimer.Start(); } Then the timer elapsed event: void TimerToUpdate_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { PopulateApplications(); } In the end the Populate method: void PopulateApplications() { dataGridView1.Rows.Clear(); foreach (Process p in Process.GetProcesses(".")) { if (p.Id != _thisProcess) { try { if (p.MainWindowTitle.Length > 0) { String status = p.Responding ? "Running" : "Not Responding"; dataGridView1.Rows.Add( p.MainWindowTitle, status); } } catch { } } } } The variable status show in the column2 but let's say i want that status will be display for each process/app in column5 ? How can i move it ? EDIT** Tried this: void PopulateApplications() { dataGridView1.Rows.Clear(); foreach (Process p in Process.GetProcesses(".")) { if (p.Id != _thisProcess) { try { if (p.MainWindowTitle.Length > 0) { var icon = Icon.ExtractAssociatedIcon(p.MainModule.FileName); Image ima = icon.ToBitmap(); img.Image = ima; img.HeaderText = "Image"; img.Name = "img"; String status = p.Responding ? "Running" : "Not Responding"; dataGridView1.Rows.Add(img, p.MainWindowTitle, status); } } catch { } } } } I moved the variable img to the top of the form. The problem is i see in each row this: DataGridViewImageColumn { Name=img, Index=-1 } And i don't see the icon it self. Why ?

    Read the article

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