Search Results

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

Page 85/113 | < Previous Page | 81 82 83 84 85 86 87 88 89 90 91 92  | Next Page >

  • Problem with usercontrol scaling when added at run-time in .Net, WinForms

    - by Jules
    First here's the steps to replicate, then I'll explain what the problem is: (1) Add a usercontrol to a form in the construtor, after the InitializeComponent call. (2) Run the form. (3) Click a button to increase the form font size. All the controls within the usercontrol scale perfectly but the usercontrol itself doesn't. It's width and height are increased by way too much. To correct the problem, the usercontrol must be added before the InitializeComponent call. If it wasn't possible for me to add the usercontrol before InitializeComponent, is there any way for me to correct the scaling?

    Read the article

  • Error when compiling a WinForms project that uses SubSonic library

    - by Mike Devenney
    The code generation is working but I get the following errors when I try to build the project: Error 4 Source file '...Project Path...\Structs.cs' could not be opened ('Unspecified error ') PPSGenerator Error 5 Source file '...Project Path...\Context.cs' could not be opened ('Unspecified error ') PPSGenerator Error 6 Source file '...Project Path...\ActiveRecord.cs' could not be opened ('Unspecified error ') PPSGenerator Error 7 Source file '...Project Path...\StoredProcedures.cs' could not be opened ('Unspecified error ') PPSGenerator I'm using VS2010 on a Windows 7 64 bit machine. Project is targeting Framework 3.5... any ideas? Also noticed the following warnings, but not sure that these are as important: Warning 1 The C# 2.0 and C# 3.5 compilers are no longer supported. Templates will always be compiled with the version 4 compiler instead of 'v3.5' as specified. ...ProjectPath...\Structs.tt 1 4 Warning 2 Multiple template directives were found in the template. All but the first one will be ignored. Multiple parameters to the template directive should be specified within one template directive. ...ProjectPath...\Settings.ttinclude 1 4 Warning 3 Compiling transformation: The variable 'parameters' is assigned but its value is never used ...ProjectPath...\SQLServer.ttinclude 92 15 Thanks! Mike D

    Read the article

  • Add Ellipsis to a Path in a WinForms Program without Win32 API call (revisited)

    - by casterle
    I was searching for a way to insert an ellipsis in a C# path, and found an answer here on stackoverflow: http://tinyurl.com/y6rmdfr Using the RTM versions of VS2010 and .Net 4.0, I was unable to get the suggested method to work. I searched the 'Net and found example code that uses the same method, but it failed in the same way. You can see the string I'm trying to shorten in my code below. After calling the MeasureText method, both the input string (OriginalName) and the output string (ellipsisedName) look like this: d:\abcd\efgh\ijkl\mnop\qrst\...\test.txt\0F\GHIJ\KLMN\OPQR\STIV\WXYZ\test.txt Two problems: 1) The resulting string is narfed (the path is truncated as expected, but is followed by what looks like a C-style terminating null and a chunk of the original path). 2) My original string is changed to be identical to the output string. Am I doing something wrong? namespace WindowsFormsApplication2 { public partial class Form1 : Form { public Form1() { InitializeComponent(); string OriginalPath = @"d:\abcd\efgh\ijkl\mnop\qrst\uvwx\yzAB\CDEF\GHIJ\KLMN\OPQR\STIV\WXYZ\test.txt"; string ellipsisedPath = OriginalPath; Size proposedSize = new Size(label1.Width, label1.Height); TextRenderer.MeasureText(ellipsisedPath, label1.Font, proposedSize, TextFormatFlags.ModifyString | TextFormatFlags.PathEllipsis); } } }

    Read the article

  • WinForms programing - Modal and Non-Modal forms problem

    - by Povilas
    I have a problem with modality of the forms under C#.NET. Let's say I have main form #0 (see the image below). This form represents main application form, where user can perform various operations. However, from time to time, there is a need to open additional non-modal form to perform additional main application functionality supporting tasks. Let's say this is form #1 in the image. On this #1 form there might be opened few additional modal forms on top of each other (#2 form in the image), and at the end, there is a progress dialog showing a long operation progress and status, which might take from few minutes up to few hours. The problem is that the main form #0 is not responsive until you close all modal forms (#2 in the image). I need that the main form #0 would be operational in this situation. However, if you open a non-modal form in form #2, you can operate with both modal #2 form and newly created non modal form. I need the same behavior between the main form #0 and form #1 with all its child forms. Is it possible? Or am I doing something wrong? Maybe there is some kind of workaround, I really would not like to change all ShowDialog calls to ShowDialog...

    Read the article

  • Securing WinForms Application suggestions

    - by Sarah Fordington
    I've been looking for a simple key/license system for our users. Its partly to stop piracy (avoid users from sharing the application around) and the other half to track the number of 'licensed users' we have. I have already read a few good suggestions on SO but I'm curious as to how people have implemented the 30 day evaluation criteria. Do you generate a key that stores the date somewhere and do a comparison each time or is it a little more complicated - deleting the file/removing the registry shouldn't deactivate. Are there any example implementations out there that can give me a head start? The irony is that our PM doesn't want to license a third-party system to do it for us. This is for a Windows Forms application.

    Read the article

  • How to make a Non Rectangular Winforms ?

    - by karthik
    I am using the below code to change to shape of the winform. Its changing the shape, but not like how i wanted. I need the forms to have curved corners. What points should i use to get it ? public void MakeNonRectangularForm() { System.Drawing.Drawing2D.GraphicsPath p = new System.Drawing.Drawing2D.GraphicsPath(); int width = this.ClientSize.Width; int height = this.ClientSize.Height; p.AddClosedCurve(new Point[]{new Point(width/2, height/2), new Point(width,0), new Point(width, height/3), new Point(width-width/3, height), new Point(width/7, height-height/8)}); this.Region = new Region(p); }

    Read the article

  • C# WinForms MultiThreading in Loop

    - by Goober
    Scenario I have a background worker in my application that runs off and does a bunch of processing. I specifically used this implementation so as to keep my User Interface fluid and prevent it from freezing up. I want to keep the background worker, but inside that thread, spawn off ONLY 3 MORE threads - making them share the processing (currently the worker thread just loops through and processes each asset one-by-one. However I would like to speed this up but using only a limited number of threads. Question Given the code below, how can I get the loop to choose a thread that is free, and then essentially wait if there isn't one free before it continues. CODE foreach (KeyValuePair<int, LiveAsset> kvp in laToHaganise) { Haganise h = new Haganise(kvp.Value, busDate, inputMktSet, outputMktSet, prodType, noOfAssets, bulkSaving); h.DoWork(); } Thoughts I'm guessing that I would have to start off by creating 3 new threads, but my concern is that if I'm instantiating a new Haganise object each time - how can I pass the correct "h" object to the correct thread..... Thread firstThread = new Thread(new ThreadStart(h.DoWork)); Thread secondThread =new Thread(new ThreadStart(h.DoWork)); Thread thirdThread = new Thread(new ThreadStart(h.DoWork)); Help greatly appreciated.

    Read the article

  • WinForms notifyicon high dpi

    - by Dubila
    in my c# application (2.0 framework) I'm using notifyicon. I set the icon to an ico file that contains 16X16 and 32X32 icons. when I change the DPI to 150% in win7 the icon looks the 16X16 icon. it looks with very low resolution.

    Read the article

  • Question on overview of C# OOP in business WinForms application - scope of Object

    - by TimR
    I may have all this OO completely wrong, but here goes: Ok the scenario is a classic order entry. Customer places an Order which has OrderLineItems of StockItems. Order is entered by Employee. 1) Application starts and asks for login/password 2) Employee selects 'Orders' from Mainmenu form 3) Orders forms opens.... 4) Employee selects Customer 5) Employee selects Stock adds to OrderLineItems 6) Selects second StockItem; add to OrderLineItems 7) Order is committed, [stock decremented, order posted to DB, Order printed] 8) Employee is returned to MainMenu Now with Object scope: 1) Application starts and asks for login/password Is this the best place to make objEmployee, to be kept whilst in this whole Sales application? 2) Employee selects 'Orders' from Mainmenu form 3) Orders forms opens.... *Make objOrderHeader, is objEmployee able to be passed in or is it created here, or re-created here.* 4) Employee selects Customer - adds/edits Customer details if required... Make objCustomer 5) Employee selects Stock adds to OrderLineItems... *Make objStockItem and objOrderLineItem - add to objOrderLineItems_collection* 6) Selects second StockItem; add to OrderLineItems... *Make objStockItem and objOrderLineItem - add to objOrderLineItems_collection* 7) Order is committed, [stock decremented, order posted to DB, Order printed, Order Entered By = EmployeeID] Once posted to Db, all objects now redundant/garbage [except objEmployee?] 8) Employee is returned to MainMenu is objEmployee still valid as an object?

    Read the article

  • WinForms / .Net interactive world map - how?

    - by FerretallicA
    In a CD collection program, I have each artist's country of origin stored in the main database and want to display a map of the world which: Colour-codes each country depending on the number of CDs by artists in that country Allows clicking on each country to filter a list of CDs to only ones by artists in that country This is a heavily simplified version of what I'm trying to do, but if I can at least get this far the rest should be easy enough to figure out. So far the closest thing I've found to what I'm trying to do is here: http://www.synergetechsolutions.com/blog/analytics-world-map-control Ideally I don't want to be embedding Flash in my program though, and the only other solutions I've found all involve SVG which I haven't managed to get working in practice outside of a web browser control (and I DEFINITELY don't want to be embedding a browser in the forms). Something in pure managed code and either GDI+ or WPF would be preferable. Are there any existing components that would get me started, or can anyone suggest how to approach it from scratch?

    Read the article

  • Weird location while moving WinForms picbox

    - by acidzombie24
    I couldnt figure the problem out so after debugging i finally decide to write the below. Why is the location jumping around?! 147 86 to 294 212 then back every callback? pic.MouseMove += my_MouseMove; my_MouseMove(object sender, MouseEventArgs e) Console.WriteLine("{0} {1} {2} {3}", e.X, e.Y, e.Location.X, e.Location.Y); 147 86 147 86 294 212 294 212 147 86 147 86 294 212 294 212 147 86 147 86 294 212 294 212

    Read the article

  • Determine number of screens and screen relative location without WinForms

    - by Philipp Schmid
    I want to save and restore the window position of my WPF application. I want to make the code robust to use with multiple monitors who's number and relative location can change (I want to avoid opening my application off-screen when the monitor configuration has changed inbetween invocations). I know of the Screen class in System.Windows.Forms, but I don't want to take a dependency on that assembly just for this feature.

    Read the article

  • Gtk equivalent for winforms BindingSource

    - by AvatarOfChronos
    Does anybody out there know of a Gtk equivalent for a System.Windows.Forms BindingSource? I'm trying to get a windows based project to work under a gtk environment and can't use the Windows.Forms dll for this. So does anybody know of a BindingSource replacement either in mono or a third party dll? (I've looked at the gtk-databindings project didn't seem to have what i need)

    Read the article

  • Element host loading time issue with winforms

    - by Vinjamuri
    I have an element host with 3 WPF controls. I am placing the element host on a winform. When my application is coming up, the element host is taking few seconds and the winform is getting displayed as a blank screen. How to fix this? Any ideas are appreciated. Basically, I don't want to display the blank screen as it looks ugly when the application is coming up.

    Read the article

  • Examples of fast .NET WPF/WinForms apps?

    - by mythz
    I am currently investigating whether to build a windows application using unmanaged C/C++ or in .NET and would like to know of the kind of performance and responsiveness that is capable with a managed C#/.NET GUI app? Not surprisingly it looks like the fastest most responsive applications (e.g. chrome, spotify, etc) are written in unmanaged C/C++. I've had a hard time finding examples of really good .NET applications and so I would like some help. What's the best example of a fast and responsive .NET windows application?

    Read the article

  • c# winforms events restore textbox contents on escape

    - by aj3jr
    Using c# in 2008 Express. I have a textbox containing a path. I append a "\" at the end on Leave Event. If the user presses 'Escape' key I want the old contents to be restored. When I type over all the text and press 'Escape' I hear a thump and the old text isn't restored. Here what I have so far ... public string _path; public string _oldPath; this.txtPath.KeyPress += new System.Windows.Forms.KeyPressEventHandler(txtPath_CheckKeys); this.txtPath.Enter +=new EventHandler(txtPath_Enter); this.txtPath.LostFocus += new EventHandler(txtPath_LostFocus); public void txtPath_CheckKeys(object sender, KeyPressEventArgs kpe) { if (kpe.KeyChar == (char)27) { _path = _oldPath; } } public void txtPath_Enter(object sender, EventArgs e) { //AppendSlash(sender, e); _oldPath = _path; } void txtPath_LostFocus(object sender, EventArgs e) { //throw new NotImplementedException(); AppendSlash(sender, e); } public void AppendSlash(object sender, EventArgs e) { //add a slash to the end of the txtPath string on ANY change except a restore this.txtPath.Text += @"\"; } Thanks in advance,

    Read the article

  • WinForms Dynamic Label

    - by tolga
    I am creating dynamic labels and letting users change attributes of the labes like backcolor and so by sending unicode. However I don't know how to check if the label exists therefore I can't manipulate the dynamicly created label. below is my code: if ((InputBox.Text.StartsWith("p")) && (InputBox.Text.EndsWith("}")))// only process if the message starts with p and ends with } { string Message = InputBox.Text; InputBox.Text = "";// Clear the box when done. // Butt1 message line if (Message.StartsWith("plabelt1")) { if (Message.StartsWith("plabelt1_BackColor")) { Message = Message.Substring(19); //labelt1.BackColor = System.Drawing.Color.FromName(Message.Replace("}", "")); } } private void ImageBox_DragDrop(object sender, DragEventArgs e) { //Graphics g = ImageBox.CreateGraphics(); //g.DrawImage((Image)e.Data.GetData(DataFormats.Bitmap), //new Point(e.X - this.Left, e.Y - this.Top - 150)); Point p2 = PointToClient(Cursor.Position); Label buttlbl_ = new Label(); labelCount++; buttlbl_.Name = "labelt" + labelCount.ToString(); buttlbl_.Location = new Point(p2.X, p2.Y); buttlbl_.Size = new System.Drawing.Size(37, 37); buttlbl_.BackColor = System.Drawing.Color.DarkGray; this.Controls.Add(buttlbl_); buttlbl_.BringToFront(); ImageBox.Invalidate(); } } Any suggestions?

    Read the article

  • Make a simple animation in winforms using a loop

    - by Michael Quiles
    I need help making this loop to move a label move smoothly across the screen using count for the animation (its required). The labels location is currently in location 0,0 I'd like to make it go in a square right - down - left - back to its original position how can I accomplish this ? please give me an example using my code below. Thank You in advance. private void xAnimeTimer_Tick(object sender, EventArgs e) { int count; this.xAnimTimer.Stop(); for (count = 0; count <= 100; count++) { this.xAnimLabel.Left = count; } for (count = 0; count <= 150; count++) { this.xAnimLabel.Top = count; }

    Read the article

< Previous Page | 81 82 83 84 85 86 87 88 89 90 91 92  | Next Page >