Search Results

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

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

  • Form invalidate() in WinForms Application

    - by Pramodh
    i need to animate an object in c# windows application int l_nCircleXpos = 9, l_nCircleYpos = 0; private void Form1_Paint(object sender, PaintEventArgs e) { Graphics l_objGraphics = this.CreateGraphics(); Pen l_circlePen = new Pen(Color.Blue); SolidBrush l_circleBrush = new SolidBrush(Color.Blue); l_objGraphics.DrawEllipse(l_circlePen, l_nCircleXpos, l_nCircleYpos, 30, 30); l_objGraphics.FillEllipse(l_circleBrush, l_nCircleXpos, l_nCircleYpos, 30, 30); Pen l_rectPen = new Pen(Color.Red); } private void timer1_Tick(object sender, EventArgs e) { l_nCircleXpos++; l_nCircleYpos++; } private void timer2_Tick(object sender, EventArgs e) { Invalidate(); } but in timer2 its invalidating the entire form. i need to invalidate the specific circle area only. please help to do this in a better way

    Read the article

  • c# winForms open forms inside mainform

    - by user508284
    Hello guys, I have programmed c# application i will post screenshot. In this main form is 3 buttons which opens different forms. Now i decided to modify this application I want to Make one main form with strip menu which will open this forms. I used this code but i don't like or i'm doing something wrong. I don't like because there is child controls(minimize, maximize, close) in parent (please see second picture ): Please advice me something. Is MDI good for such job? Thanks! Sell sell = new Sell(); sell.MdiParent = this; sell.Dock = DockStyle.Fill; sell.Show();`

    Read the article

  • Hidden Features of Visual Studio winforms designer

    - by CodingBarfield
    One of the most loved and hated feautures of visual studio must be the form designer. Creating a simple form/user control layout usually is a breeze. Setting properties and adding events is easy. Setting up the toolbox to use you own controls can be a bit harder and getting the ToolBoxIcons to show up can be a pain. Using third party components by visual inheritance can throw of the designer. And using multiple inheritance on designerables can be really hard. So what are your favorite 'hidden' and or obvious visual studio designer features.

    Read the article

  • C# WinForms. Multiple Forms in separate threads

    - by Calum Murray
    I'm trying to run an ATM Simulation in C# with Windows Forms that can have more than one instance of an ATM machine transacting with a bank account simultaneously. The idea is to use semaphores/locking to block critical code that may lead to race conditions. My question is this: How can I run two Forms simultaneously on separate threads? In particular, how does all of this fit in with the Application.Run() that's already there? Here's my main class: public class Bank { private Account[] ac = new Account[3]; private ATM atm; public Bank() { ac[0] = new Account(300, 1111, 111111); ac[1] = new Account(750, 2222, 222222); ac[2] = new Account(3000, 3333, 333333); Application.Run(new ATM(ac)); } static void Main(string[] args) { new Bank(); } } ...that I want to run two of these forms on separate threads... public partial class ATM : Form { //local reference to the array of accounts private Account[] ac; //this is a reference to the account that is being used private Account activeAccount = null; private static int stepCount = 0; private string buffer = ""; // the ATM constructor takes an array of account objects as a reference public ATM(Account[] ac) { InitializeComponent(); //Sets up Form ATM GUI in ATM.Designer.cs this.ac = ac; } ... I've tried using Thread ATM2 = new Thread(new ThreadStart(/*What goes in here?*/)); But what method do I put in the ThreadStart constructor, since the ATM form is event-driven and there's no one method controlling it? Thanks, Calum

    Read the article

  • Winforms, databinding, Listbox and textbox

    - by Snake
    Hi dear friends, I have a ListBox (MyListBox) on my screen, and a Textbox (MyTextBox). The ListBox is filled with a List(Of T), which are all custom items. Now I try to do this: The ListBox' datasource is the List(Of T). Now when an Item changes I want the textbox to be updated to a particular property of the selected item in my ListBox. In code this means: Me.MyListBox.DisplayMember = "SelectionName" Me.MyListBox.ValueMember = "Id" MyTextbox.DataBindings.Add(New Binding("Text", Me._listOfItems, "SelectedItem.Comment", True, DataSourceUpdateMode.OnPropertyChanged)) Me.MyListBox.DataSource = Me._listOfItems this does not work. But when I bind to SelectedValue instead of SelectedItem it works perfectly. The _listOfItems is declared as this: Dim _listOfItems As List(Of MyItem) = New List(Of MyItem)() Where MyItem is this: public class MyItem { public string SelectionName { get; set; } public int Id { get; set; } public string Comment { get; set; } } I tried overriding the ToString() in MyItem so that it would use that. But that doesn't work either. Anybody care to give it a try? Thanks! -Snakiej

    Read the article

  • C# / 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

  • WinForms modal windows alt+tab problem

    - by PaN1C_Showt1Me
    Hi ! Suppose multiple Modal Windows shown above each other. All of those have ShowInTaskbar = false, which means that in the TaskBar you only see the MainForm and all Modal Windows are hidden. Now you press ALT+ TAB and the most upper modal Windows disappears. But you cannot get it back in front. How should be this done correctly in your opinion?

    Read the article

  • Winforms for Mono on Mac, Linux and PC (Redux)

    - by yar
    (I asked this question in another way, and got some interesting responses but I'm not too convinced.) Is Mono's GtkSharp truly cross-platform? It seems to be Gnome based... how can that work with PC and Mac? Can someone give me examples of a working Mac/PC/Linux app that is written with a single codebase in Microsoft .Net?

    Read the article

  • Datagridview Winforms Add or Delete Rows in Edit Mode with Collection Binding

    - by user630548
    In my datagridview, I bind a List of objects named 'ProductLine'. But unfortunately with this approach I cannot 'Add' or 'Delete' rows to the datagridview in edit mode. When I create a fresh new order I can Add or Delete rows but once I save it and try to open it in Edit then it doesn't let me 'Add' or 'Delete' (via keyboard). Any idea? Here is the code for this: If it is a fresh Order then I do something like this: private void Save(){ for (int i = 0; i <= dtgProdSer.RowCount - 1; i++) { if ((itemList != null) && (itemList.Count > i)) productLine = itemList[i]; else productLine = new ProductLine(); productLine.Amount = Convert.ToDouble(dataGridViewTextBoxCell.Value); } } And if it is an Edit then in the Form_Load I check ProductId is NON Zero then I do the following: private void fillScreen{ dtgProdSer.DataSource = itemList; } But with this I cannot Add or Delete Rows in Edit mode. Any advise is greatly appreciated.

    Read the article

  • MainMenu with Images (WinForms, C#)

    - by j-t-s
    Hi All I have a MainMenu in my app and I would like to have little icons relevant to the Item in each menu. But the MainMenu control does not support this. I would use the MenuStrip control, though that is a pretty ugly option in my opinion. Does anybody have any suggestions? Are there any free/open source alt's out there, or would it be easy/possible to implement that feature into the existing MainMenu control? Thanks

    Read the article

  • passing values between forms (winforms)

    - by dnkira
    Hello. Vierd behaviar when passing values to and from 2nd form. ParameterForm pf = new ParameterForm(testString); works ParameterForm pf = new ParameterForm(); pf.testString="test"; doesn't (testString defined as public string) maybe i'm missing something? anyway i'd like to make 2nd variant work properly, as for now - it returns null object reference error. thanks for help. posting more code here: calling Button ParametersButton = new Button(); ParametersButton.Click += delegate { ParameterForm pf = new ParameterForm(doc.GetElementById(ParametersButton.Tag.ToString())); pf.ShowDialog(this); pf.test = "test"; pf.Submit += new ParameterForm.ParameterSubmitResult(pf_Submit); }; definition and use public partial class ParameterForm : Form { public string test; public XmlElement node; public delegate void ParameterSubmitResult(object sender, XmlElement e); public event ParameterSubmitResult Submit; public void SubmitButton_Click(object sender, EventArgs e) { Submit(this,this.node); Debug.WriteLine(test); } } result: Submit - null object reference test - null object reference

    Read the article

  • How can I attach a Silverlight OOB to a Winforms panel?

    - by JohnMcCon
    Summary: I want the prettiness of Silverlight/WPF in part of my current Winforms application. The application can only have access to the full .NET Framework 2.0, no more and no less. The only possibility I can think of is a Silverlight OOB application that utilizes Com+ Automation but I can't figure out how to attach the Silverlight application to a panel within the parent Winforms application. Details: I currently have a winforms application, and want to take advantage of the improved GUI features in WPF but to many of my users are still running .Net Framework 2.0 and refuse to update to 3+. So WPF is not an option for me. I know Silverlight is just a subset of WPF, but it has most of the features I'm looking for and only requires the Silverlight plug-in. I've read about Silverlight 4's Com+ Automation, which would give me access to the full desktop .Net Framework 2.0 (which I need). In order for Com+ Automation to work in Silverlight I need elevated trust and the only way I can find to gain elevated trust is to make my Silverlight application Out-Of-Browser (OOB). My problem is that the OOB application seems to run in its own container window and I need the Silverlight application embedded inside a panel in my Winforms application. My Winforms application does not need to communicate with the Silverlight application and vice-versa, this is purely to have everything contained and displayed in one window. If there is another way to get my desired result that I have not thought of feel free to suggest it.

    Read the article

  • .net question - where are the DefaultCredentials stored/accessed from for a WinForms v3.5 app?

    - by Greg
    Hi, Where are the DefaultCredentials stored/accessed from for a WinForms v3.5 app? That is if I am using the settings for defaultProxy for my Winforms v3.5 application, and set a proxy server address here, exactly where does/can the username/password come from? Or in other words where does the framework source the "default credentials" for a winforms application running on the client PC? <defaultProxy enabled="true|false" useDefaultCredentials="true|false" <bypasslist> … </bypasslist> <proxy> … </proxy> <module> … </module> /> Background - apparently ClickOnce can use this for a client side application, however I'm trying to work out where click once would get this defaultCredential from, for a user who is running the clickonce install for my winforms application.

    Read the article

  • How to access the Desktop Composition Engine from a WinForms app?

    - by MusiGenesis
    Is it possible to access Desktop Composition Engine in Windows Vista from a winforms application? The DCE apparently involves applications rendering to DCE buffers instead of directly to the screen. Since a winforms app has no way of getting information about the monitor's refresh rate and scanline status (other than via DirectX), animation in a winforms app is subject to tearing effects. With DCE enabled, the tearing effects are lessened but still there (apparently the DCE can still grab a buffer that your app is halfway through writing to and render it to the screen, thereby producing the half-one-frame-half-of-the-next tearing effects). Is there any way for my winforms app to communicate with the DCE and possible avoid rendering during buffer switchover times?

    Read the article

  • How can I schedule tasks in a WinForms app?

    - by Greg
    QUESTION: How can I schedule tasks in a WinForms app? That is either (a) what is the best approach / .NET classes/methods to use of (b) if there is an open source component that does this well which one would be recommended. BACKGROUND: Winforms app (.NET v3.5, C#, VS2008) I'm assuming I will run the winforms application always, and just minimise to the system tray when not in use Want a simple approach (didn't want to get into separate service running that UI winforms app talks to etc) Want to be able to let the user select how often to schedule the sync (e.g. hourly, daily - pick time, etc) Ability to at the times when the scheduler fires to run a chunk of code (assume it could be wrapped as a backgroundworker task for example) The application is always running & appears in the system tray

    Read the article

  • Is there a compact or express SQL Server version that I can package with my WinForms app & is free?

    - by Greg
    Hi, Is there a light weight version of SQL Server I could use that has the characteristics of: Free (assuming my winforms app is semi-commercial) Can be seemlessly packaged for deployment as part of the winforms click-once application? (i.e. ease in installation for the user). Light weight for the user (ideally something that just runs when the winforms application that uses it is running - but better than using XML sererialization for persistance). Thanks

    Read the article

  • What's are the best readings to start using WPF instead of WinForms?

    - by Ivan
    Keeping in mind what CannibalSmith once said - "All the answers are saying "WPF is different". That's a huge understatement. You not only have to learn lots of new stuff - you must forget everything you've learned from Forms. It's a completely new way of doing UI." .. and having many years of experience with visual Windows desktop applications development (VB6, Borland C++ Builder VCL, WinForms) (which is hard to forget), how do I quickly move to developing to say well-formed WPF applications with Visual Studio? I don't need boozy-woozy graphics to give my app look and feel of a Hollywood blockbuster or a million dollar pyjamas. I always loved tidiness of standard Windows common controls and UI design guidelines, end even more I enjoyed them under Vista Glass Aero Graphite sauce. I am perfectly satisfied with WinForms but I want to my applications to be built of the most efficient and up-to-date standard technologies and architectured according to the most efficient and flexible patterns of today and tomorrow, leveraging interface-based integration and functionality reuse and to take all advantages of modern hardware and APIs to maximize performance, usability, reliability, maintainability, extensibility, etc. I very much like the idea of separating view, logic and data, letting a view to take all advantages of the platform (may it run as a web browser applet on a thin client or as a desktop application on a PC with a latest GPU), letting logic be reused, parallelized and seamlessly evolve, storing data in a well structured format in a right place. But... while moving from VB6 to Borland C++ Builder was very easy (no books/tutorials needed to turn it on and start working) (assuming I already knew C++), moving from BCB to WinForms was the same seamless, it does not seem any obvious to me how to do with WPF. So how do I best convert myself from a WinForms developer into a right-way thinking and doing WPF developer?

    Read the article

  • c#: what is the purpose of wpf vs. winforms [closed]

    - by every_answer_gets_a_point
    i know wpf can be richer-looking, but what is the point of using them if they complicate things so much? for example if i want to do something on form load in wpf i have to through the trouble of writing this: public MyWindow() { Loaded += MyWindow_Loaded; } private void MyWindow_Loaded(object sender, RoutedEventArgs e) { // do work here } whereas in winforms all i do is double click on the form the question is what are the benefits of using wpf over winforms?

    Read the article

  • How to avoid visual artifacts when hosting WPF user controls within a WinForms MDI app?

    - by jpierson
    When hosting WPF user controls within a WinForms MDI app there is a drawing issue when you have multiple forms that overlap each other that causes very distinct visual artifacts. These artifacts are mostly visible after dragging one child form over another one that also hosts WPF content or by allowing the edges of the child form to be clipped by the main MDI parent when dragging it around. After the drag and drop of the child form is completed the artifacts stay around gernally but I've found that setting focus to a different application's window and then refocusing back on to my application window that it is redrawn and all is good again until the child forms are moved once again. Please see the image below which demonstrates the problem. Since many at Microsoft insist that the WinForms MDI is already a complete solution for MDI even when dealing with WPF I find it hard to believe any of them have ever actually tried creating a mostly WPF app that utilizes WinForms MDI otherwise it would be hard to recommend while keeping a straignt face. I'm hoping to either come up with proof that this solution truly is not acceptable or possibly find a way to overcome this and a few other specific issues.

    Read the article

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