Search Results

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

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

  • C#.Net window application EXE and SQL SERVER 2000 Database at Client Machine

    - by user1397931
    Friends I have install a .net window application exe at client machine and its database in sql server 2000. For Exe I install .net framework and other support software and for DB i install sql server 2000 and Create Database over there and connect it. Working Properly But now client change Xp to window7. I search for installation of SQL Server 2000 , but its not working over there. So what i did, i send the MDF file of database with exe application and make connection string and its also working. Now i change something in DB , and trying to update .mdf file but its not reflecting the new one mdf its getting the old one. i am Stuck...... am i did any wrong ? because its difficult for me to fix. OR i want to know what is the efficient way of use of SQL Server 2000 database on window7 or any else solution is there? Please help me...

    Read the article

  • How can I loop through all the open instances of a particular form?

    - by raz3r
    I need to update a ListBox of a Form2 created dinamically. Let's say that in the event where I have to update this ListBox (in Form1 of course) I don't have a reference of this Form2 so I can't call the UpdateList method (and no, I can't make it static). I don't even know if there is a Form2 opened, it could be or not. What do you suggest? Is there a way to loop through all the open istances of Form2? Code Sample: //Form1 public void event() { //UPDATE FORM2 LISTBOX } //SOMEWHERE IN FORM1 Form2 runTime = new Form2(); //Form2 public void UpdateList() { //UPDATE LISTBOX }

    Read the article

  • System.IO.File.ReadAllText(path) does not read the html file.

    - by Harikrishna
    I want to read the html file.And for that I use System.IO.File.ReadAllText(path).It can read all the html file but there is one file which is not read through this function. I have also used using (StreamReader reader = File.OpenText(fileName)) { text = reader.ReadToEnd(); But still there is same problem. What is the reason can be there ? And for that what can be the solution ? Or any other way to read the file ?

    Read the article

  • Close child form if already open

    - by j-t-s
    Hi All How can I go about closing a Child form if it's already open? And if it isn't already open, then open it? Thank you I already have this code, which doesn't work, obviously: Form ibx = new inbox(); if(ibx.Visible) ibx.Dispose(); else ibx.Show(); All that the above does is creates a new form whether or not it's already open.

    Read the article

  • Computing Form Location with Button

    - by user2934515
    I'm working on a programming assignment, and I'm trying to make this button take the values from two textboxes, and calculate the new location for the form window. I'm having trouble converting the textbox values to type int, and being made usable by the btnCompute_click method. private void btnCompute_Click(object sender, EventArgs e) { int x = Convert.ToInt32(txtXvalue); int y = Convert.ToInt32(txtYvalue); Location = new Point(x,y); } private void xValue_TextChanged(object sender, EventArgs e) { int xValue = Convert.ToInt32(txtXvalue); } private void yValue_TextChanged(object sender, EventArgs e) { int y = Convert.ToInt32(txtYvalue); } I forgot to add some additional info, the acceptable values for x and y must be positive. Would I use an if...else statement to control the acceptable values?

    Read the article

  • My WindowsFormsApplication going behind of all application.

    - by SharpUrBrain
    Hi all, I developed a WindowsFormsApplication having a Form of Border Style as "FixedToolWindow", now the problem is while I am going to minimize any other opened application then my application going behind of all the application opened already. I am not getting where the problem is exactly. So can anybody help me to find out where the problem and how to short out it ? Any help will be appreciated. Thanks in Advance

    Read the article

  • DocumentCompleted event when the page is fully loaded in WebBrowser form (Windows Forms C#)

    - by Tolga E
    I use the DocumentCompleted but this gets fired multiple times. Now I've seen this example if (e.Url.AbsolutePath != this.webBrowser.Url.AbsolutePath) which is used to confirm that the requested file is completed loading but this gets fired before anything else (like images) on the page is loaded. Thus I'm still not able to tell when a webpage is fully loaded. Is there a way to ensure that the webpage has fully loaded and there's nothing being loaded?

    Read the article

  • Update the Progress bar using winforms c#

    - by karthik
    There is a functionality in my module, where the user can scan the number of serial ports in the system and when the user clicks "Auto scan" button, the code will have to go through each serial port and send a test message and wait for the reply. I am using Progress bar control to show process of autoscan. For which i need to pass the value to "x" and "Y" in my code to update the bar. How can i pass the value since my code is already in a foreach loop for getting the serialports. Y = should pass the value of total number of serial ports X = should iterate through each port and pass the value Hope i am clear with req. private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { string strAckData = ""; foreach (SerialPort sp in comPortsList) { sp.Open(); string sendData = "Auto scan"; sp.Write(sendData); strAckData += "Connection live on port " + sp.ReadExisting() + "\n"; sp.Close(); double dIndex = (double)x; **//How to pass the value here ?** double dTotal = (double)y; **//How to pass the value here ?** double dProgressPercentage = (dIndex / dTotal); int iProgressPercentage = (int)(dProgressPercentage * 100); // update the progress bar backgroundWorker1.ReportProgress(iProgressPercentage); } richTextBox1.Invoke(new MethodInvoker(delegate { richTextBox1.Text = strAckData; })); } private void backgroundWorker1_ProgressChanged(object sender, ProgressChangedEventArgs e) { ProgressBar.Value = e.ProgressPercentage; } private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { StatusLabel.Text = "Auto Scan completed"; }

    Read the article

  • Embedding IronPython in a WinForms app and interrupting execution

    - by namenlos
    BACKGROUND I've successfully embedded IronPython in my WinForm apps using techniques like the one described here: http://blog.peterlesliemorris.com/archive/2010/05/19/embedding-ironpython-into-a-c-application.aspx In the context of the embedding, my user may any write loops, etc. I'm using the IronPython 2.6 (the IronPython for .NET 2.0 and IronPython for .NET 4.0) MY PROBLEM Sometimes the users will need to interrupt the execution of their code In other words they need something like the ability to hit CTRL-C to halt execution when running Python or IronPython from the cmdline I want to add a button to the winform that when pressed halts the execution, but I'm not sure how to do this. MY PROBLEM The users will need to interrupt the execution of their code In other words they need something like the ability to hit CTRL-C to halt execution when running Python or IronPython from the cmdline MY QUESTION How can I make it to that pressing the a "stop" button will actually halt the execution of the using entered IronPython code? NOTES Note: I don't wont to simply through away that "session" - I still want the user to be able to interact with session and access any results that were available before it was halted. I am assuming I will need to execute this in a separate thread, any guidance or sample code in doing this correctly will be appreciated.

    Read the article

  • WinForms Taskbar Icon - Click Event not firing

    - by Greycrow
    I have created a non-form c# program that uses the NotifyIcon class. The text "(Click to Activate)" shows up when I hover the mouse. So I am getting some events handled. However, The "Click" event does not fire and the Context menu doesnt show up. public class CTNotify { static NotifyIcon CTicon = new NotifyIcon(); static ContextMenu contextMenu = new ContextMenu(); static void Main() { //Add a notify Icon CTicon.Icon = new Icon("CTicon.ico"); CTicon.Text = "(Click to Activate)"; CTicon.Visible = true; CTicon.Click += new System.EventHandler(CTicon_Click); //Create a context menu for the notify icon contextMenu.MenuItems.Add("E&xit"); //Attach context menu to icon CTicon.ContextMenu = contextMenu; while (true) //Infinite Loop { Thread.Sleep(300); //wait } } private static void CTicon_Click(object sender, System.EventArgs e) { MessageBox.Show("Clicked!"); } }

    Read the article

  • C# Winforms: PropertyGrid not updated when item added to Collection

    - by MysticEarth
    I've got a custom class which can be edited through the PropertyGrid. In that class I've got a custom Collection (with custom PropertyDescriptor and TypeConverter). Items can be added to or removed from the Collection with the default Collection Editor. This all works fine. But - after closing the Collection Editor, the PropertyGrid is not updated. When I manual make a call to Refresh() on the PropertyGrid, the changes are reflected in the PropertyGrid. How can I get the PropertyGrid to automatically refresh when the Collection Editor has been closed? I sought for a solution earlier where I should subclass CollectionEditor (which I can't seem to find). Please help.

    Read the article

  • (C#, WinForms) How to assign an accessibility attribute to an image in ImageList

    - by Yaniv
    Hi all, I'm trying to find a way to make a screen-reader (like JAWS) to read out loud some text that is assigned to images in ImageList. In other controls (like PushButton) there is "AccessibleName" property, that when contains text, it's being read by JAWS. the ImageList consists of four icons that represent priorities, and no text is displayed near them. Is it possible to do it? Can you think of any other creative solution? Thanks, Yaniv.

    Read the article

  • WinForms Control.BeginInvoke asynchronous callback

    - by Darran
    I have a number of Janus grid controls that need to be populated on an application startup. I'd like to load these grids on different threads to speed startup time and the time it takes to refresh these grids. Each grid is on a seperate tab. Ideally I'd like to use Control.BeginInvoke on each grid and on the grid load completing the tabs will become enabled. I know with Delegates you can do a Asynchronous callback when using BeginInvoke, so I could enable the tabs in the asynchronous callback, however when using Control.BeginInvoke this is not possible. Is there a way to do asynchronous callbacks using Control.BeginInvoke or possibly a better solution? So far I have: public delegate void BindDelegate(IMyGrid grid); private IAsyncResult InvokeBind(IMyGrid grid) { return ((Control)grid).BeginInvoke( new BindDelegate(DoBind), new object[] { grid } ); } private void DoBind(IMyGrid grid) { grid.Bind(); // Expensive operation } private void RefreshComplete() { IAsyncResult grid1Asynch = InvokeBind(grid1); IAsyncResult grid2Asynch = InvokeBind(grid2); IAsyncResult grid3Asynch = InvokeBind(grid2); IAsyncResult grid4Asynch = InvokeBind(grid3); IAsyncResult grid5Asynch = InvokeBind(grid4); IAsyncResult grid6Asynch = InvokeBind(grid5); } Now I could spin off a separate thread and keep checking to see if the IAsynchResults have completed and depending on which one completes I could re-enable the Tab control that the grid is contained in. Is there a better way of doing this?

    Read the article

  • What is your best-practice advice on implementing SQL stored procedures (in a C# winforms applicatio

    - by JYelton
    I have read these very good questions on SO about SQL stored procedures: When should you use stored procedures? and Are Stored Procedures more efficient, in general, than inline statements on modern RDBMS’s? I am a beginner on integrating .NET/SQL though I have used basic SQL functionality for more than a decade in other environments. It's time to advance with regards to organization and deployment. I am using .NET C# 3.5, Visual Studio 2008 and SQL Server 2008; though this question can be regarded as language- and database- agnostic, meaning that it could easily apply to other environments that use stored procedures and a relational database. Given that I have an application with inline SQL queries, and I am interested in converting to stored procedures for organizational and performance purposes, what are your recommendations for doing so? Here are some additional questions in my mind related to this subject that may help shape the answers: Should I create the stored procedures in SQL using SQL Management Studio and simply re-create the database when it is installed for a client? Am I better off creating all of the stored procedures in my application, inside of a database initialization method? It seems logical to assume that creating stored procedures must follow the creation of tables in a new installation. My database initialization method creates new tables and inserts some default data. My plan is to create stored procedures following that step, but I am beginning to think there might be a better way to set up a database from scratch (such as in the installer of the program). Thoughts on this are appreciated. I have a variety of queries throughout the application. Some queries are incredibly simple (SELECT id FROM table) and others are extremely long and complex, performing several joins and accepting approximately 80 parameters. Should I replace all queries with stored procedures, or only those that might benefit from doing so? Finally, as this topic obviously requires some research and education, can you recommend an article, book, or tutorial that covers the nuances of using stored procedures instead of direct statements?

    Read the article

  • simple c# arythmetics. winForms

    - by jello
    I'm doing simple divisions in c#, and I am a bit puzzled by its intricacies. Here's some code, and in the comments, the result. (btw, I only compile with 1 line not commented, if you say that I have 5 declarations of the same variable) double result = 2 / 3; //gives 0 double result = Convert.ToDouble(2) / Convert.ToDouble(3); // is good double result = double.Parse(2) / double.Parse(3); // gives me errors double result = double.Parse(2 / 3); // gives me errors double result = Convert.ToDouble(2 / 3); // gives 0 MessageBox.Show(result.ToString()); so if you have a bunch of integers you wanna mess with, you have to convert each one to a double. pretty tedious...

    Read the article

  • Disabling redraw in WinForms app

    - by Ryan
    I'm working on a C#.Net application which has a somewhat annoying bug in it. The main window has a number of tabs, each of which has a grid on it. When switching from one tab to another, or selecting a different row in a grid, it does some background processing, and during this the menu flickers as it's redrawn (File, Help, etc menu items as well as window icon and title). I tried disabling the redraw on the window while switching tabs/rows (WM_SETREDRAW message) at first. In one case, it works perfectly. In the other, it solves the immediate bug (title/menu flicker), but between disabling the redraw and enabling it again, the window is "transparent" to mouse clicks - there's a small window (<1 sec) in which I can click and it will, say, highlight an icon on my desktop, as if the app wasn't there at all. If I have something else running in the background (Firefox, say) it will actually get focus when clicked (and draw part of the browser, say the address bar.) Here's code I added. m = new Message(); m.HWnd = System.Windows.Forms.Application.OpenForms[0].Handle; //top level m.WParam = (IntPtr)0; //disable redraw m.LParam = (IntPtr)0; //unused m.Msg = 11; //wm_setredraw WndProc(ref m); <snip - Application ignores clicks while in this section (in one case) m = new Message(); m.HWnd = System.Windows.Forms.Application.OpenForms[0].Handle; //top level m.WParam = (IntPtr)1; //enable m.LParam = (IntPtr)0; //unused m.Msg = 11; //wm_setredraw WndProc(ref m); System.Windows.Forms.Application.OpenForms[0].Refresh(); Does anyone know if a) there's a way to fix the transparent-application problem here, or b) if I'm doing it wrong in the first place and this should be fixed some other way?

    Read the article

  • label backgrond flicking on a WinForms user control has background image enabled

    - by slowlycooked
    I am working on a windows form project and having some problem with UserControl Double Buffering. I created a usercontrol and has a background image, then on top of it I have few radio buttons and labels. Radio buttons and labels are all having transparent background as color. However, when I show and hide the User control, I can see the flickering on those labels and radio buttons that has transparent background. And I tried Me.SetStyle(ControlStyles.DoubleBuffer _ Or ControlStyles.AllPaintingInWmPaint _ Or ControlStyles.UserPaint _ Or ControlStyles.SupportsTransparentBackColor, _ True) After initializeComponent() to enable double buffer on this user control, but it doesn’t seem to work.

    Read the article

  • Invalid Cast Exception in ASP.NET but not in WinForms

    - by Shadow Scorpion
    I have a problem in this code: public static T[] GetExtras <T>(Type[] Types) { List<T> Res = new List<T>(); foreach (object Current in GetExtras(typeof(T), Types)) { Res.Add((T)Current);//this is the error } return Res.ToArray(); } public static object[] GetExtras(Type ExtraType, Type[] Types) { lock (ExtraType) { if (!ExtraType.IsInterface) return new object[] { }; List<object> Res = new List<object>(); bool found = false; found = (ExtraType == typeof(IExtra)); foreach (Type CurInterFace in ExtraType.GetInterfaces()) { if (found = (CurInterFace == typeof(IExtra))) break; } if (!found) return new object[] { }; foreach (Type CurType in Types) { found = false; if (!CurType.IsClass) continue; foreach (Type CurInterface in CurType.GetInterfaces()) { try { if (found = (CurInterface.FullName == ExtraType.FullName)) break; } catch { } } try { if (found) Res.Add(Activator.CreateInstance(CurType)); } catch { } } return Res.ToArray(); } } When I'm using this code in windows application it works! But I cant use it on ASP page. Why?

    Read the article

  • simple c# arithmetics. winForms

    - by jello
    I'm doing simple divisions in c#, and I am a bit puzzled by its intricacies. Here's some code, and in the comments, the result. (btw, I only compile with 1 line not commented, if you say that I have 5 declarations of the same variable) double result = 2 / 3; //gives 0 double result = Convert.ToDouble(2) / Convert.ToDouble(3); // is good double result = double.Parse(2) / double.Parse(3); // gives me errors double result = double.Parse(2 / 3); // gives me errors double result = Convert.ToDouble(2 / 3); // gives 0 MessageBox.Show(result.ToString()); so if you have a bunch of integers you wanna mess with, you have to convert each one to a double. pretty tedious...

    Read the article

  • Databind List Of Objects To A WinForms DataGridView, But Not Show Certain Public Properties

    - by Pyronaut
    I'm not even sure if i'm doing this correctly. But basically I have a list of objects that are built out of a class. From there, I am binding the list to a datagrid view that is on a Windows Form (C#) From there, it shows all the public properties of the object, in the datagrid view. However there is some properties that i still need accessible from other parts of my application, but aren't really required to be visible in the DataGridView. So is there an attribute or something similar that I can write above the property to exclude it from being shown. P.S. Im binding at runtime. So i cannot edit the columns via the designer. P.P.S. Please no answers of just making public variables (Although if that is the only way, let me know :)).

    Read the article

  • WinForms/Console application on Mono, how to know it runs as root

    - by Lex Li-MSFT
    As we can execute such executables in two ways, such as "sudo mono test.exe", and "mono test.exe". Now I want to know how to detect whether this application is running as root inside the application itself. I tried to check user name like below and see whether they equal to "root", Thread.CurrentPrincipal.Identity.Name Process.GetCurrentProcess().StartInfo.UserName AppDomain.CurrentDomain.ApplicationIdentity.FullName The first two are empty strings always, while the third throws NullReferenceException. Please advise if this is doable on Mono 2.6.

    Read the article

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