Search Results

Search found 17 results on 1 pages for 'windowsforms'.

Page 1/1 | 1 

  • WindowsForms difference to simple Console App

    - by daemonfire300
    I currently started to "port" my console projects to WinForms, but it seems I am badly failing doing that. I am simply used to a console structure: I got my classes interacting with each other depending on the input coming from the console. A simple flow: Input -> ProcessInput -> Execute -> Output -> wait for input Now I got this big Form1.cs (etc.) and the "Application.Run(Form1);" But I really got no clue how my classes can interact with the form and create a flow like I described above. I mean, I just have these "...._Click(object sender....)" for each "item" inside the form. Now I do not know where to place / start my flow / loop, and how my classes can interact with the form.

    Read the article

  • C#, WindowsForms difference to simple Console App

    - by daemonfire300
    Hi there, I currently started to "port" my console projects to WinForms, but it seems I am badly failing doing that. I am simply used to a console structure: I got my classes interacting with each other depending on the input coming from the console. A simple flow: Input -> ProcessInput -> Execute -> Output -> wait for input Now I got this big Form1.cs (etc.) and the "Application.Run(Form1);" But I really got no clue how my classes can interact with the form and create a flow like I described above. I mean, I just have these "...._Click(object sender....)" for each "item" inside the form. Now I do not know where to place / start my flow / loop, and how my classes can interact with the form. thanks and regards daemonfire

    Read the article

  • WinForms TabControl: How to avoid tab-rendering on DrawMode=OwnerDrawFixed?

    - by splattne
    I extended the (WindowsForms) built-in TabControl in order to implement closing tabs right on the tab itself ("x" image on the right like in Webbrowsers). The inherited control renders the text and images. Also, it uses visual styles on hover etc. All works very well, but I have one problem I can't solve. When the tabs are rendered, I cannot avoid that the Control paints the tabs another time as seen in this screenshot: That's a problem for two reasons: It looks ugly on the selected tab I'd like to increase the tabs' width because the current width doesn't take account of the "x" image on the right Any idea how to solve this?

    Read the article

  • GMap.NET shows no map

    - by Mariusz
    I'm trying to use the GMap.NET.WindowsForms control in my Windows forms application but I cannot make it show me any map. Here is what I did: I added the control to my Visual Studio's 2010 toolbox by clicking 'Choose Items...' from the toolbox's context menu and browsing for the GMap.NET.WindowsForms.dll included in the downloaded zip archive. I also added references to GMap.NET.Core.dll and System.Data.SQLite.dll in my solution. Then I put the GMapControl that appeared in the toolbox on the main form of my application and set the map type to GoogleMap. When I run my application, however, the control shows either a blue screen with a piece of text saying "We are sorry, but we don't have imagery at this zoom level for this region" or a bright screen with completely no data (when I change zoom level). Here is my code: GMapMain.MapType = MapType.GoogleMap; GMapMain.MaxZoom = 100; GMapMain.MinZoom = 0; GMapMain.Zoom = 50; GMapMain.CurrentPosition = new PointLatLng(54.6961334816182, 25.2985095977783); GMapMain.ReloadMap(); Please help. I have no idea what to do and I cannot find any information in the Internet that could help me solve the problem. Thank you very much in advance.

    Read the article

  • How to extract file paths out of drag and drop event?

    - by trismarck
    I have this application that lists files in a WindowsForms listbox (NET framework). The application does not support the copy operation if multiple files are selected in the listbox, but at the same time, the application supports 'drag and drop' event for multiple files (allows dragging the files 'out of the application'). How can I extract the paths of the files 'dragged out of the application'? (i.e. I drop the files on some program / script that shows me the paths / saves the paths to a txt file).

    Read the article

  • How to run unit tests in STAThread mode?

    - by Peter
    I would like to test an app that uses the Clipboard (WindowsForms) and I need the Clipboard in my Unittests also. In order to use it, it should run in STA mode, but since the NUnit Testfixture does not have a main method, I don't know where/how to annotate it... Thanks!

    Read the article

  • Looking for design help

    - by jess
    I have this scenario in most of the WindowsForms having grids I have a sequence of code which is similar - AddNewRow(in grid),CreateNewEntity,notifyUser,few other steps Now, I want to use a template kind of pattern.But,my issue is with CreateEntity method since sometimes it is passed a parameter which is different depending on the type of object being created.Should I make createentity accept an "object" type,and cast when the parameter is to be used.What other way can I tackle this design issue? Also,CreateEntity returns the object being created.

    Read the article

  • What is the correct way to create a single instance application?

    - by Nidonocu
    Using C# and WPF under .net (rather than WindowsForms or console), what is the correct way to create an application that can only be run as a single instance? I know it has something to do with some mythical thing called a mutex, rarely can I find someone that bothers to stop and explain what one of these are. The code needs to also inform the already running instance that the user tried to start a second one, and maybe also pass any command line arguments if any existed.

    Read the article

  • C# 5.0 Async/Await Demo Code

    - by Paulo Morgado
    I’ve published the sample code I use to demonstrate the use of async/await in C# 5.0. You can find it here. Projects PauloMorgado.AyncDemo.WebServer This project is a simple web server implemented as a console application using Microsoft ASP.NET Web API self hosting and serves an image (with a delay) that is accessed by the other projects. This project has a dependency on Json.NET due to the fact the the Microsoft ASP.NET Web API hosting has a dependency on Json.NET. The application must be run on a command prompt with administrative privileges or a urlacl must be added to allow the use of the following command: netsh http add urlacl url=http://+:9090/ user=machine\username To remove the urlacl, just use the following command: netsh http delete urlacl url=http://+:9090/ PauloMorgado.AsyncDemo.WindowsForms This Windows Forms project contains three regions that must be uncommented one at a time: Sync with WebClient This code retrieves the image through a synchronous call using the WebClient class. Async with WebClient This code retrieves the image through an asynchronous call using the WebClient class. Async with HttpClient with cancelation This code retrieves the image through an asynchronous call with cancelation using the HttpClient class. PauloMorgado.AsyncDemo.Wpf This WPF project contains three regions that must be uncommented one at a time: Sync with WebClient This code retrieves the image through a synchronous call using the WebClient class. Async with WebClient This code retrieves the image through an asynchronous call using the WebClient class. Async with HttpClient with cancelation This code retrieves the image through an asynchronous call with cancelation using the HttpClient class.

    Read the article

  • best way to reference business objects from presentation layer..?

    - by Vytas999
    I want to develop an enterprise app that includes a WindowsForms presentation layer, middle-tier components for business logic and data access, and a MsSQL Server database. Middle-tier components should contain some business objects and will be called from presentation layer using .NET Remoting. Whitch is the best way (and why) to reference these business objects from presentation layer? a) Create class library project, implementing business objects. Reference this project from presentation layer and middle-tier layer. b) Create interface library project defining business objects. Create class library project implementing interfaces. Reference class library project from middle-tier layer. Reference interface library project from presentation layer. c) Create separate class library projects for middle-tier and presentation layer. Reference corresponding project from presentation layer.

    Read the article

  • Questions every good .NET developer should be able to answer?

    - by splattne
    My company is about to hire .NET developers. We work on a variety of .NET platforms: ASP.NET, Compact Framework, Windowsforms, Web Services. I'd like to compile a list/catalog of good questions, a kind of minimum standard to see if the applicants are experienced. So, my question is: What questions do you think should a good .NET programmer be able to respond? I'd also see it as a checklist for myself, in order to see where my own deficits are (there are many...). *UPDATE: It want to make clear that we're not testing only for .NET knowledge, and that problem solving capabilities and general programming skills are even more important to us.

    Read the article

  • Mostrar Imagenes en ListView utilizando ImageList WinForms

    - by Jason Ulloa
    El día de hoy veremos como trabajar con los controles ListView e Imagelist de WindowsForms para poder leer y mostrar una serie de imágenes. Antes de ello debo decir que pueden existir otras formas de mostrar imagenes que solo requieren un control por ejemplo con un Gridview pero eso será en otro post, ahora nos centraremos en la forma de realizarlo con los controles antes mencionados. Lo primero que haremos será crear un nuevo proyecto de windows forms, en mi caso utilizando C#, luego agregaremos un Control ImageList. Este control será el que utilicemos para almacenar todas las imágenes una vez que las hemos leído. Si revisamos el control, veremos que tenemos la opción de agregar la imágenes mediante el diseñador, es decir podemos seleccionarlas manualmente o bien agregarlas mediante código que será lo que haremos. Lo segundo será agregar un control ListView al Formulario, este será el encargado de mostrar las imagenes, eso sí, por ahora será solo mostrarlas no tendrá otras funcionalidades. Ahora, vamos al codeBehind y en el Evento Load del form empezaremos a codificar: Lo primero será, crear una nueva variable derivando DirectoryInfo, a la cual le indicaremos la ruta de nuestra carpeta de imágenes. En nuestro ejemplo utilizamos Application.StartUpPath para indicarle que vamos a buscar en nuestro mismo proyecto (en carpeta debug por el momento). DirectoryInfo dir = new DirectoryInfo(Application.StartupPath + @"\images");   Una vez que hemos creado la referencia a la ruta, utilizaremos un for para obtener todas la imágenes que se encuentren dentro del Folder que indicamos, para luego agregarlas al imagelist y empezar a crear nuestra nueva colección. foreach (FileInfo file in dir.GetFiles()) { try { this.imageList1.Images.Add(Image.FromFile(file.FullName)); }   catch { Console.WriteLine("No es un archivo de imagen"); } }   Una vez, que hemos llenado nuestro ImageList, entonces asignaremos al ListView sus propiedades, para definir la forma en que las imágenes se mostrarán. Un aspecto a tomar en cuenta acá será la propiedad ImageSize ya que está será la que definirá el tamaño que tendrán las imágenes en el ListView cuando sean mostradas. this.listView1.View = View.LargeIcon;   this.imageList1.ImageSize = new Size(120, 100);   this.listView1.LargeImageList = this.imageList1;   Por último y con ayuda de otro for vamos a recorrer cada uno de los elementos que ahora posee nuestro ImageList y lo agregaremos al ListView para mostrarlo for (int j = 0; j < this.imageList1.Images.Count; j++) { ListViewItem item = new ListViewItem();   item.ImageIndex = j;   this.listView1.Items.Add(item); } Como vemos, a pesar de que utilizamos dos controles distintos es realmente sencillo  mostrar la imagenes en el ListView al final el control ImageList, solo funciona como un “puente” que nos permite leer la imagenes para luego mostrarlas en otro control. Para terminar, los proyectos de ejemplo: C# VB

    Read the article

  • UI Design, incase of numerous situations

    - by The King
    Hi... I'm creating a web form, where in there are around 12-15 Input Fields... You can have a look at the screen and The request is such that depending on the data the user selects in the Gridview and the DropDown list, the appropriate Textboxes and CheckBoxes needs to be displayed. Some times the conditions are very direct, like when the DDL value is "ABC", get only paid amount from the user. Sometime they are so complex like... IF DDL is "DEF" and Selected GPMS value is between 1000-2000, calculate the values of allowed, paid etc (using some formula) and the focus should be directed to Page No Field, leaving the other fields open incase user wants to edit... There are around 10-15 conditions like this. As this was done through agile, conditions were being added as and when, and wherever it feels appropriate (DDL on change Event, GridView on selecting change event etc... etc..) After completion, now I see the code has become a big chuck, is growing unmanageably... Now, I'm planning to clear this... From you experience, what you think is the best way to handle this. There is a possibility to add more conditions like this in future... Please let me know, incase you need more information. I'm currently developing this app in C# .Net WindowsForms Edit: Currently there are only three items (The Datagrid, the DDL, the OverrideAmt CheckBox) that change the way other fields behave... Almost all of the conditions will fall between the two situations I mentioned... Mostly they belong to "Enabling/Disabling".. "Setting of Values"... and "Changing Focus" or any combination of these.

    Read the article

  • Strategies for "Always-Connected" Windows Client Data Architecture

    - by magz2010
    Hi. Let me start by saying: this is my 1st post here, this is a bit lenghty, and I havent done Windows Forms development in years....with that in mind please excuse me if this isn't directly a programming question and please bear with me as I really need the help!! I have been asked to develop a Windows Forms app for our company that talks to a central (local area network) Linux Server hosting a PostgreSQL database. The app is to allow users to authenticate themselves into the system and thereafter conduct the usual transactions with the PG database. Ordinarily, I would propose writing a webforms app against Mono, but the clients need to utilise local resources such as USB peripheral devices, so that is out of the question. While it might not seem clear, my questions are italised below: Dilemma #1: The application is meant to be always connected. How should I structure my DAL/BLL - Should this reside on the server or with the client? Dilemma #2: I have been reading up on Client Application Services (CAS), and it seems like a great fit for authentication, as everything is exposed via URIs. I know that a .NET Data Provider exists for PostgreSQL, but not too sure if CAS will all work on a Linux (Debian) server? Believe me, I would get my hands dirty and try myself, but I need to come up with a logical design first before resources are allocated to me for "trial purposes"! Dilemma #3: If the DAL/BLL is to reside on the server, is there any way I can create data services, and expose only these services to authenticated clients. There is a (security) requirement whereby a connection string with username and password to the database cannot be present on any client machines...even if security on the database side is quite rigid. I'm guessing that the only way for this to work would be to create the various CRUD data service methods that are exposed by an ASP.NET app, and have the WindowsForms make a request for data or persist data to the ASP.NET app (thru a URI) and have that return a resultset or value. Would I be correct in assuming this? Should I be looking into WCF Data Services? and will WCF work with a non-SQL Server database? Thank you for taking the time out to read this, but know that I am desperately seeking any advice on this! THANKS A MILLION!!!!

    Read the article

1