Search Results

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

Page 100/113 | < Previous Page | 96 97 98 99 100 101 102 103 104 105 106 107  | Next Page >

  • Boiler plate code replacement - is there anything bad about this code?

    - by Benjol
    I've recently created these two (unrelated) methods to replace lots of boiler-plate code in my winforms application. As far as I can tell, they work ok, but I need some reassurance/advice on whether there are some problems I might be missing. (from memory) static class SafeInvoker { //Utility to avoid boiler-plate InvokeRequired code //Usage: SafeInvoker.Invoke(myCtrl, () => myCtrl.Enabled = false); public static void Invoke(Control ctrl, Action cmd) { if (ctrl.InvokeRequired) ctrl.BeginInvoke(new MethodInvoker(cmd)); else cmd(); } //Replaces OnMyEventRaised boiler-plate code //Usage: SafeInvoker.RaiseEvent(this, MyEventRaised) public static void RaiseEvent(object sender, EventHandler evnt) { var handler = evnt; if (handler != null) handler(sender, EventArgs.Empty); } } EDIT: See related question here UPDATE Following on from deadlock problems (related in this question), I have switched from Invoke to BeginInvoke (see an explanation here). Another Update Regarding the second snippet, I am increasingly inclined to use the 'empty delegate' pattern, which fixes this problem 'at source' by declaring the event directly with an empty handler, like so: event EventHandler MyEventRaised = delegate {};

    Read the article

  • How to exit a WPF app programmatically?

    - by j-t-s
    Hi All In the few years I've been using C# (WINFORMS), I've never used WPF. But now I love WPF, but I don't know how the hell I am supposed to exit my application when the user clicks on the Exit menu item from the File menu. Can somone please help me out!? I DID google this, and guess what? For such a Simple? thing... Nothing related came up. Thanks P.S. I have tried: this.Dispose(); this.Exit(); Application.ShutDown(); Application.Exit(); Application.Dispose(); ... Among many others. Nothing works.

    Read the article

  • Data import wizard library for .Net?

    - by Phil
    Does anyone know of a 3rd party data import wizard that can be embedded into applications? It should import from Excel, Access, SQLServer, csv, tab-separated flat file, XML, Oracle etc. We have a fixed data structure within our application and the user should be able to configure the wizard to match his/her import fields to our own data structure. The wizard should be a library of sorts – preferably a .Net type library. We may want to have it both web-based and desktop based (hence we may need an ASP.Net controls version and a Winforms version). We may also want integration with WPF and Silverlight. If there’s no UI wizard available, does anyone know of a non-UI library that supports easily configurable import from many, many different datasources?

    Read the article

  • Visual Studio : Make files in a folder got to bin/debug and not bin/debug/folder

    - by CF_Maintainer
    Consider This: I have folder called \SQLCE35Dlls inside my solution. It has some dlls that are required for application to interact with a SQLCE database in a stand alone fashion [without sql server ce 35 install on the PC]. After a build, I want these files to go to bin/debug and not to bin/debug/SQLCE35Dlls/. Setting "Copy if Newer" creates the latter situation. I want the former. Is it possible to facilitate this or does this have to done as part of the installer script? [avoiding the solution of adding the dlls at the root level of the solution instead of inside a folder]. This is a Winforms project solution.

    Read the article

  • How do I get a TextBox to only accept numeric input in WPF?

    - by Giffyguy
    I'm looking to accept digits and the decimal point, but no sign. I've looked at samples using the NumericUpDown control for WinForms, and this sample of a NumericUpDown custom control from Microsoft. But so far it seems like NumericUpDown (supported by WPF or not) is not going to provide the functionality that I want. The way my app is designed, nobody in their right mind is going to want to mess with the arrows. They don't make any practical sense, in the context of my app. So I'm looking for a simple way to make a standard WPF TextBox accept only the characters that I want. Is this possible? Is it practical? Thanks, SO!

    Read the article

  • My first .net web app - should I go straight to MVC framework (c.f. ASP.net)

    - by Greg
    Hi, I'm done some WinForms work in C# but now moving to have to develop a web application front end in .NET (C#). I have experience developing web apps in Ruby on Rails (& a little with Java with JSP pages & struts mvc). Should I jump straight to MVC framework? (as opposed to going ASP.net) That is from the point of view of future direction for Microsoft & as well ease in ramping up from myself. Or if you like, given my experience to date, what would the pros/cons for me re MVC versus ASP.net? thanks

    Read the article

  • Wrapping WPF UserControl inside VisualStudio Item Template

    - by karthik84
    I am currently started working on a project which will allow users to design reports inside visual studio. Previously, for my similar Winforms App, I had extended the IComponent (Component Class) and wrote our VS Like designer kind of custom control which will allow users to drag drop controls from the visual studio toolbox and then I export it as a VisualStudio C#&VB ItemTemplate. Now I am trying to recreate the same control using WPF considering its power, extensiblity. Could anyone shed some lights on this, on what would be the most preferable way of doing this ? Thanks in advance.

    Read the article

  • How reusable should ViewModel classes be?

    - by stiank81
    I'm working on a WPF application, and I'm structuring it using the MVVM pattern. Initially I had an idea that the ViewModels should be reusable, but now I'm not too sure anymore. Should I be able to reuse my ViewModels if I need similar functionality for a WinForms application? Silverlight doesn't support all things WPF does - should I be able to reuse for Silverlight applications? What if I want to make a Linux GUI for my application. Then I need the ViewModel to build in Mono - is this something I should strive for? And so on.. So; should one write ViewModel classes with one specific View in mind, or think of reusability?

    Read the article

  • ASP.Net MVC - Build a load on demand TreeView

    - by Eric P
    I am wondering how to build a load on demand tree view using ASP.Net MVC. I understand what is involved in creating a JQuery TreeView using lists, but the load on demand part is really confusing me. I don't need the full solution, but can somebody point me in the right direction on where I should start? I have done these plenty of times using WinForms which keeps the view state preserved. One of the issues I am seeing is remembering all the node that have been expanded and not just the newly expanded one. If anyone had some advice, I would appreciate it. Thanks!

    Read the article

  • Dock Panel component for .NET that allows docking inside tab-pages?

    - by Lasse V. Karlsen
    I want to build a user-interface that, for historical reasons, has a lot of "columns" of information. Many of these aren't relevant for all users in all cases, so I thought I'd look at dock panels to allow the users to hide or rearrange the columns according to their job scenario. This is Winforms in .NET 3.5. As such, I'd like the following: Have tab-pages in the main form Each tab-page can have dock-panels docked into them Dock-panels should be movable from one tab-page to another I've tried the following component packages so far without luck: Telerik Allows me to dock inside a tab-page, but dock-panels can't move from one tab-page to another. When attempting to drop a floating panel onto a different tab-page than the one it came from, it appears the dock will succeed, but when dropped it is docked on its owner container. Divelements SandDoc Same problems as with Telerik. DevExpress XtraBars Same problems as with Telerik. Basically, does anyone know of any such component (package) that would allow me to do what I want?

    Read the article

  • Force Richtextbox scrollbars to refresh

    - by Jiri
    This question is about WinForms RichTextbox. I have a RichTextbox with ScrollBars property set to Vertical. I change it's RTF contents from the code and sometimes the vertical scrollbar appears disabled - when it should be enabled. This should never happen - the scrollbar should be either enabled, or not shown at all. (I had a similar issue in my VB6 app, when the scrollbar sometimes didn't appear at all when it should). Is there any way how to force the RichTextbox scrollbars to refresh, via PInvoke or any other way to fix this issue? Thanks.

    Read the article

  • HOW TO SElect line number in TextBox Multiline

    - by Alhambra Eidos
    Hi all, I have large text in System.Windows.Forms.TextBox control in my form (winforms), vs 2008. I want find a text, and select the line number where I've found that text. Sample, I have fat big text, and I find "ERROR en línea", and I want select the line number in textbox multiline. string textoLogDeFuenteSQL = @"SQL*Plus: Release 10.1.0.4.2 - Production on Mar Jun 1 14:35:43 2010 Copyright (c) 1982, 2005, Oracle. All rights reserved. ** MORE TEXT **** Conectado a: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production With the Partitioning, Data Mining and Real Application Testing options WHERE LAVECODIGO = 'CO_PREANUL' * ERROR en línea 2: ORA-00904: ""LAVECODIGO"": identificador no v?lido INSERT INTO COM_CODIGOS * ERROR en línea 1: ORA-00001: restricción única (XACO.INX_COM_CODIGOS_PK) violada"; ** MORE TEXT **** Any sample code about it ? thanks in advanced,

    Read the article

  • How to protect web site against hackers?

    - by Adi barda
    Hi Guys, Like everyone of us, I have my own dreams about developing the next cool product that will be adopted by many users and become industry standard. Surprisingly, I find that the most challenging task is to keep my website up & running. My site is being hacked again and again no matter what I do - I blocked the FTP connections, changed the Joomla (CMS) database table names, installed all latest patches and what not. The web site supports the product (over 1800 users now...) by generating licenses, support forums, documentation, galleries etc. The product which is a winforms application cannot be marketed without this web site. My question: Do you have any innovative idea about securing joomla based web sites or what is the best secured web hosting you know. currently i'm hosting my site at ixwebhosting and i like them very much but obviously i can't do any serious marketing being hacked over and over again Thank you very much, Adi Barda

    Read the article

  • The .NET ActiveX component with WPF content can't be loaded by non MFC app

    - by lonelyflyer
    I have a legacy delphi program and want to add some content implemented with WPF. So I encapsulate the WPF control with a .NET/ActiveX interop technology. That means something like: [ComRegisterFunction()] public static void RegisterClass(string key); [ComUnregisterFunction()] public static void UnregisterClass(string key); The activeX component is a WinForms User Control and the WPF materials are attached to an ElemenHost in this User Control. It works fine if the host app of this ActiveX is a MFC program even without /clr switch. But my legacy app is a delphi program, and it always throw a stackoverflow exception within the constructor of my WPF user control as the program be started. I have no clue, Google is no help. and it has puzzled me for days.

    Read the article

  • How to enforce min-width/height of a control to be always visible in WPF?

    - by MartyIX
    Hello, I've got an application and I would like to know if there's a way how to keep the whole visual element always visible. I thought that minWidth/minHeight will do that but it only changes the minimal size of the element but it doesn't enforces that the whole visual element is visible. I think what I need is minWidth from WinForms where it works exactly as I need. Example: Setting minWidth and minHeight for Window works but if I set minWidth for a StackPanel in Window the window can be resized so that the minWidth of StackPanel is ignored (actually the StackPanel has the requested size but it's hidden). Thank you for any suggestion!

    Read the article

  • What is the equivalent to Java's canvas object in C#?

    - by Winston
    I'm working on creating a basic application that will let a user draw (using a series of points) and I plan to do something with these points. If this were Java, I think I would probably use a canvas object and some Java2D calls to draw what I want. All the tutorials I've read on C#/Drawing involve writing your own paint method and adding it to the paint event for the form. However, I'm interested in having some traditional Form controls as well and I don't want to be drawing over them. So, is there a "Canvas" object where I can constrain what I'm drawing on? Also, is WinForms a poor choice given this use case? Would WPF have more features that would help enable me to do what I want? Or Silverlight?

    Read the article

  • Metatool for automatic xml code generation

    - by iceman
    I want to develop a programming tool for developers which can do automatic xml code generation for specifying a GUI design and its controls. The aim is to allow non-programmers specify GUI controls(which in this case perform higher level task unlike WinForms ) from a GUI. So the xml code generated is essentially an internal representation which programmers can understand and further use in any automatic GUI generator. So the workflow is GUI(non-programmers)-xml(for programmers)-GUI(non-programmers). Is there a Microsoft project similar to this?

    Read the article

  • Storing credit card details

    - by Andrew
    I have a business requirement that forces me to store a customer's full credit card details (number, name, expiry date, CVV2) for a short period of time. Rationale: If a customer calls to order a product and their credit card is declined on the spot you are likely to lose the sale. If you take their details, thank them for the transaction and then find that the card is declined, you can phone them back and they are more likely to find another way of paying for the product. If the credit card is accepted you clear the details from the order. I cannot change this. The existing system stores the credit card details in clear text, and in the new system I am building to replace this I am clearly not going to replicate this! My question, then, is how I can securely store a credit card for a short period of time. I obviously want some kind of encryption, but what's the best way to do this? Environment: C#, WinForms, SQL-Server.

    Read the article

  • Advantage of using Thread.Start vs QueueUserWorkItem

    - by Cheeso
    In multithreaded .NET programming, what are the decision criteria for using ThreadPool.QueueUserWorkItem versus starting my own thread via new Thread() and Thread.Start()? In a server app (let's say, an ASP.NET app or a WCF service) I think the ThreadPool is always there and available. What about in a client app, like a WinForms or WPF app? Is there a cost to spin up the thread pool? If I just want 3 or 4 threads to work for a short period on some computation, is it better to QUWI or to Thread.Start().

    Read the article

  • Do you know of a free .Net component for visual flow model graph design and editing?

    - by Ivan
    An app (C#4, WinForms, Entity Framework, SQL Server 2008) of mine maintains a graph of interconnected objects, each having some simple member fields and a set of many directed (in and out) one-to-one links to other objects. I'd like to offer a user an ability to view and edit this graph visually some way, creating and removing connections, modifying objects attributes values and introducing/dropping objects. I suppose there has to be a framework (at list a primitive kind of) for this as visual model design tools are pretty common to meet. Do you know one?

    Read the article

  • How can I add array data in winform datagridview?

    - by Phsika
    I generated Personel[] type array from Biz.Bal.GetPersonelById("1") but if I want to add winforms, I do that like below. Is there any simple method? Like GridView.dataSource=myArray? private void Form1_Load(object sender, EventArgs e) { Form_init(); Model.Personel[] list = new Model.Personel[0]; list = Biz.BAL.GetPersonelByID("1"); dataGridView1.Rows[0].Cells[0].Value = list[0].ID; dataGridView1.Rows[0].Cells[1].Value = list[0].Ad; dataGridView1.Rows[0].Cells[2].Value = list[0].SoyAd; dataGridView1.Rows[0].Cells[3].Value = list[0].Maas; dataGridView1.Rows[0].Cells[4].Value = list[0].Departman; }

    Read the article

  • C# and Linq: Generating SQL Backup/Restore From Code

    - by mdvaldosta
    I'm working with a C# and Linq to SQL Winforms app and needed to integrate backup and restores through the program. I used SMO and got it working pretty smoothly. The issue, however, is that the app is deployed using ClickOnce, which I like very much - but since I had to include the dll's the download size jumped from 3mb = 15mb. I know they've only got to download it once, but it also sucks for me as Visual Studio 2010 seems to upload the dll's every time and that takes a while on AT&T broadband (eh). So, anyone have any suggestion on how I can work out an effective backup/restore solution without using SMO objects?

    Read the article

  • WCF does not generate the properties

    - by BDotA
    I have a .NET 1.1 ASMX and want to use it in a client WinForms app. If i go wit the old way and add it as a "WebRefrence" method then I will have access to two of its properties which are "url" and "UseDefaultCredentials" and it works fine. But if I go with the new WCF way and add it as a ServiceReference I still have access to the methods of that ASMX but those two properties are missing. what is the reason for that? so for example in the old way ( adding WebReference) these codes are valid: TransferService transferService= new TransferService(); transferService.Url = "http://something.asmx"; transferService.Credentials = System.Net.CredentialCache.DefaultCredentials; string[] machines = transferService.GetMachines(); But in the new way ( adding Service Reference ) using(TransferServiceSoapClient transferServiceSoapClient = new TransferServiceSoapClient("TransferServiceSoap")) { transferServiceSoapClient.Url = "someUrl.asmx"; //Cannot resolve URL transferServiceSoapClient.GetMachines(new GetMachinesRequest()); transferServiceSoapClient.Credentials = .... // //Cannot resolve Credentials }

    Read the article

  • What to write in "Web location" field when starting an "New website" in Visual Studio 2010?

    - by Ivan
    I want a website to be deployed automatically to a local IIS (built in Windows XP Pro SP3), avoiding VisualStudio-built-in server if possible. I'd like development source files to be stored in a project folder outside wwwroot (I wouldn't mind built files to be copied to wwwroot each time I press F5). I don't store my projects inside default directories inside "My documents". What should I specify as in "Web location" when starting an "New website" in Visual Studio 2010? A deployment path in wwwroot, a folder where I'd like to save my project, or something else? I want the website to be a part of a complex solution in VS 2010, also icludinc a class libray project, a WinForms application project, a Windows Service project and a common Entitity Framework data model.

    Read the article

  • Send file by webservice

    - by phenevo
    Hi, I have webservice, wwith method: [WebMethod] public byte[] GetFile(string FName) { System.IO.FileStream fs1 = null; fs1 = System.IO.File.Open(FName, FileMode.Open, FileAccess.Read); byte[] b1 = new byte[fs1.Length]; fs1.Read(b1, 0, (int)fs1.Length); fs1.Close(); return b1; } and it works with small file like 1mb, but when it comes to photoshop's file (about 1,5gb) I get: System.OutOfMemoryException The idea is I have winforms application which get this file and saving it on local disc.

    Read the article

< Previous Page | 96 97 98 99 100 101 102 103 104 105 106 107  | Next Page >