Search Results

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

Page 52/113 | < Previous Page | 48 49 50 51 52 53 54 55 56 57 58 59  | Next Page >

  • If I replace an image in a PictureBox control, should I dispose the original image first? .Net Winfo

    - by Jules
    Following on from my question here http://stackoverflow.com/questions/2548664/long-overdue-for-me-question-about-disposing-managed-objects-in-net-vb-net , If I replace an image in a picture box, should I dispose the original image first? Or, what about this situation: Dim bm As New Bitmap(32,32) bm = New Bitmap(32,32) bm = New Bitmap(32,32) bm = New Bitmap(32,32) Does bm need only to be disposed at the end, or should it be disposed before each re-creation?

    Read the article

  • How to make a thread stay runnig in c#

    - by menachem
    Hello, I have a Windows Form Application (Form1) that allow the user to open another Forms (FormGraph). In order to open the FormGraph App I use a thread that open it. Here is the code that the thread is running: private void ThreadCreateCurvedGraph() { FormGraph myGraph = new FormGraph(); myGraph.CreateCurvedGraph(...); myGraph.Show(); } My problem is that myGraph closed right after it's open. 1) Does anyone know why this is happening and how to make myGraph stay open? 2) After the user closed myGraph, How do I terminate the thread? Many thanks!

    Read the article

  • Dynamically showing fields to a Dev Express Grid view on windows form

    - by Bhaskar
    In one of windows application in C# , I am using Dev Express Grid view control to bind some data and display it to user. I have custom business objects with properties defined for this purpose.Then I simple set the DataSource of the grid to the list of my custom business objects. A while ago , there came a requirement which means that the columns to be displayed on to the grid will be dynamic. This means I cannot know at design time which fields I will need to display. I was thinking of abandoning setting the DataSource and populating the grid manually by code. But I think this will cause many of the grid's features not to work properly, for example , grouping the data by drag n drop of fields to the header area etc. Is there any way to tell a grid at runtime to skip certain fields from a list of BO's when databinding to the grid ?

    Read the article

  • Reading email content

    - by Steve
    Hi, Hope someone may be able to help. What i am looking to do is create a small winform app in c# to read the content of a email from a pop account, and upload key values to a sql automatically. The email format is always the same for each email, eg, First name : Last name : Phone number : etc... Currently the emails are being stored in a pop 3 account however i want a way to reduce having to key the information into the sql by hand. Can anyone advise how i would go about doing this or could recommend some guides? Thanks. Steve

    Read the article

  • Cascade the MDI forms of a Splitter panel

    - by BDotA
    I am showing my MDI windows inside the main form but in one part of the splitter panel, like this: Form2 f2= new Form2(); f2.MdiParent = this; f2.Parent = this.splitContainer2.Panel2; f2.Show(); but the problem is that I cannot cascade them if I write a code like this: this.LayoutMdi(System.Windows.Forms.MdiLayout.Cascade); "this" is the parent form. the main form. Hoe can I cascade them? thanks all.

    Read the article

  • Refresh databases data

    - by Simon
    How can i refresh the data from my database(ms access) in c# using windows form aplication? part of the code where i insert the data : insertCommand.Parameters.Add("@ID_uporabnika", OleDbType.Integer).Value = Convert.ToInt32(textBox6.Text); insertCommand.Parameters.Add("@datum", OleDbType.DBDate).Value = DateTime.Now.ToShortDateString(); insertCommand.Parameters.Add("@ID_zivila", OleDbType.Integer).Value = Convert.ToInt32(iDTextBox.Text); insertCommand.Parameters.Add("@skupaj_kalorij", OleDbType.Double).Value = Convert.ToDouble(textBox1.Text); empConnection.Open(); try { int count = insertCommand.ExecuteNonQuery(); } catch (OleDbException ex) { MessageBox.Show(ex.Message); } finally { empConnection.Close(); MessageBox.Show("zauižiti obrok je bil shranjen"); textBox1.Clear(); textBox2.Clear(); textBox3.Clear(); textBox4.Clear(); textBox5.Clear(); } }

    Read the article

  • Failing to send key presses to a running process in C#

    - by Waffles
    I'm using the following code to put the focus on a window (in this case, a notepad window), and sending some key presses to it everytime button 2 is clicked. However, when I press button 2, nothing happens. Can anyone tell my why my sendkeys command is failing? public partial class Form1 : Form { [DllImport("user32.dll")] static extern bool ShowWindow(IntPtr hWnd, int nCmdShow); private Process s; public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { this.s = new Process(); s.StartInfo.FileName = "notepad"; s.Start(); s.WaitForInputIdle(); } private void button2_Click(object sender, EventArgs e) { ShowWindow(s.MainWindowHandle, 1); SendKeys.SendWait("Hello"); } }

    Read the article

  • What is the best way to call a method right AFTER a form loads?

    - by Jordan S
    I have a C# windows forms application. The way I currently have it set up, when Form1_Load() runs it checks for recovered unsaved data and if it finds some it prompts the user if they want to open that data. When the program runs it works alright but the message box is shown right away and the main program form (Form1) does not show until after the user clicks yes or no. I would like the Form1 to pop up first and then the message box prompt. Now to get around this problem before I have created a timer in my Form, started the timer in the Form1_Load() method, and then performed the check and user prompt in the first Timer Tick Event. This technique solves the problem but is seems like there might be a better way. Do you guys have any better ideas? Edit: I think I have also used a background worker to do something similar. It just seems kinda goofy to go through all the trouble of invoking the method to back to the form thread and all that crap just to have it delayed a couple milliseconds!

    Read the article

  • Quicken like Windows Forms application

    - by WinFXGuy
    Hi All, I need to build a quicken like application, where data needs to be secure. I don't see any database being used by Quicken. I could use XML, MDF or Access database, but data is not secure in the tables. What is the best option? How does Quicken handle it? My application may also have document attachments as well. The functionality of this application is similar to quicken but not an accounting/financial in functionality. Thanks a bunch!

    Read the article

  • How can I draw a Rectangle on a PictureBox?

    - by TooFat
    I am trying to just draw a Rectangle on a PictureBox that is on a Form. Writing text like shown here works fine. private void pictureBox1_Paint(object sender, PaintEventArgs e) { using (Font myFont = new Font("Arial", 14)) { e.Graphics.DrawString("Hello .NET Guide!", myFont, Brushes.Green, new Point(2, 2)); } } but when I try to draw a rectangle like so nothing shows up. private void pictureBox1_Paint(object sender, PaintEventArgs e) { Rectangle rect = new Rectangle(); rect.Location = new Point(25, 25); rect.Width = 50; using (Pen pen = new Pen(Color.Red, 2)) { e.Graphics.DrawRectangle(pen, rect); } } What am I missing?

    Read the article

  • How do I add/remove items to a ListView in virtual mode?

    - by Eric
    If I'm using a ListView in virtual mode then, as I understand it, the list view only keeps track of a small number of items in the list. As the user scrolls it dynamically retrieves items it needs to show from the virtual list. But what if an item is added or removed from the master list? If an item is added/removed outside of the range of indexes being shown by the list view then I would assume the list view would show the added/missing items when the user scrolls to that index. Is this correct? But what if an item is added/removed from the range of indexes the user is currently viewing? How do I trigger the list view to refresh the items it is currently viewing to show the new/missing items?

    Read the article

  • Multiplayer game

    - by j-t-s
    Using either XNA OR just the usual c# win forms application, which would be the best way to create the feature that enables text messages to be sent from me to my friend over the internet? I don't know if this matters or not, but I now have 3 Mobile Broadband internet... so it's like... Wireless internet, does that matter?

    Read the article

  • Hanging Forms When I Drag And Move My Forms

    - by hosseinsinohe
    I Write a Windows Application By C Sharp. I Use a Picture in Background of my Form (MainForm) And I Use Many Picture in Buttons in This Form,And also I Use Some Panel And Label with Transparent Background Color. My Forms,Panels And Buttons has flicker. I solve this problem by a method in this thread. But Still when other Forms Start over this Form,my Forms hangs when I Drag and Move my Forms over this Form.How can I Solve this Problem to Move And Drags my Forms easily And Speed? Edit:: My Forms Load Data From Access 2007 DataBase file.I Use Datasets,DataGridViews And Other Components to Load And show Data in My Forms.

    Read the article

  • Prevent Casual Piracy for Simple Utility

    - by Chad
    I've written a small utility that I wish to sell for less than $10. My primary concern is "casual piracy". The scenario that plays out in my mind is this: User buys the program, enjoys using it and tells their friends. The friends copy the application to their USB drives and take it home - using the application for free (maybe never realizing they should have purchased it. Since I've got absolutely no protection built in, it would just be a simple copy'n paste to pirate the app. The users who would be using the app are in close proximity to each other (work in the same environment), so casual piracy would likely occur frequently. Any ideas? Keeping in mind the app is cheap (partly to reduce casual piracy), and the level of effort to write the app hasn't been very demanding. Update: the app will run on any system that supports .NET 3.5.

    Read the article

  • System.Drawing - bad text rendering using DrawString on top of transparent pixels.

    - by mackenir
    When rendering text into a bitmap, I find that text looks very bad when rendered on top of an area with non-opaque alpha. The problem is progressively worse as the underlying pixels become more transparent. If I had to guess I'd say that when underlying pixels are transparent, the text renderer draws any anti-aliased 'gray' pixels as solid black. Here are some screenshots: Text drawn on top of transparent pixels: Text drawn on top of semi-transparent pixels: Text drawn on opaque pixels: Here is the code used to render the text: g.SmoothingMode = SmoothingMode.HighQuality; g.DrawString("Press the spacebar", Font, Brushes.Black, textLeft, textTop);

    Read the article

  • What causes my borderless C++/CLI app to crash when overriding WndProc?

    - by Ste
    I use a form with border NONE. I need to override WndProc for resize and move form. However, using this code, my app crashes! static const int WM_NCHITTEST = 0x0084; static const int HTCLIENT = 1; static const int HTCAPTION = 2; protected: virtual void Form1::WndProc(System::Windows::Forms::Message %m) override { switch (m.Msg) { case WM_NCHITTEST: if (m.Result == IntPtr(HTCLIENT)) { m.Result = IntPtr(HTCAPTION); } break; } Form1::WndProc(m); } virtual System::Windows::Forms::CreateParams^ get() override { System::Windows::Forms::CreateParams^ cp = __super::CreateParams; cp->Style |= 0x40000; return cp; } How can I fix my code not to crash but still allow my form to be moved and resized?

    Read the article

  • Using a WinForm as a Windows Installer Custom Action

    - by Serexx
    Hello - I am working on in installer project that needs to gather some info and act on it during the install (mainly online key retreival and registration). The Setup Project UserInterface templates seem inflexible and poorly documented so I am looking at opening a WinForm as a Custom Action. I know this is possible because I see reference to it in many places but this is my first Windows Installer experience and so far it is mired in googled contradictions, partial or outdated information and guesswork... erg.... Does anyone have (even a pointer to) a clear concise description of how one gets this done in a VS 2008 WinForm project... Many thanks for inputs

    Read the article

  • how can i get notified on every control clicked in another application?

    - by Dizzy
    Hi all, Im writing an application that needs to get notified when a control in another application is clicked\invoked. How can i catch the click from my application? Here are some more related questions : Is UIAutomation can be a solution? is it working on unmanaged applications also? Is the Spy++ solution works also on managed applications? i'll be happy with any help.

    Read the article

  • Regarding Visual C# MenuItem: Where does the NullReference come from?

    - by Thomas
    Hi All. I have a problem creating MenuItems for a TreeView dynamically: here is the (simplified)code i'm using. public class CTM : TreeNode, IComparable, IComparable<CTM> { public CTM(CTMProvider provider) { this.provider = provider; this.manager = provider.manager; this.IEEEAddress = provider.IEEEAddress; this.endpoint = provider.state._conn.RemoteEndPoint; this.Text = String.Format("CTM: {0} {0}", IEEEAddress, ((System.Net.IPEndPoint)endpoint).ToString()); try { MenuItem meni = System.EventHandler(this.provider.Disconnect)); this.ContextMenu.MenuItems.Add(meni); } catch { Trace.TraceError("Could not create menu item!"); } } } This code always triggers the catch clause with a NullReferenceException. Any Ideas?

    Read the article

  • How can I reorder columns in a DataGridView?

    - by Luiscencio
    so I fill my DGV with some data and set some columns invisible: var part = inventory.espiromex_product.Where(p => p.descriptionsmall == cmbMainP.Text).First().partnumberp; dtgAssy.DataSource = inventory.espiromex_productsub.Where(p => p.partnumberp == part); dtgAssy.Columns["idproductsub"].Visible = false; dtgAssy.Columns["partnumberp"].Visible = false; dtgAssy.Columns["partnumbersubp"].Visible = true; dtgAssy.Columns["quantity"].Visible = true; dtgAssy.Columns["comments"].Visible = true; dtgAssy.Columns["assemblyno"].Visible = false; dtgAssy.Columns["assemblynodesc"].Visible = false; dtgAssy.Columns["uomid"].Visible = true; dtgAssy.Columns["subassemblylevelnumber"].Visible = false; dtgAssy.Columns["scrappercent"].Visible = true; this is just fine but columns are sorted Alphabetically, How can I reorder columns programmatically? note that inventory is an Entitie and I am using Linq to Entities.

    Read the article

  • How to make a panel behave like a modal for the form

    - by The King
    Hi All, I have a MDI child Form which displays items that are already in the database. I use a datagridview (PostedItemsDataGrid) to display the items... I also have a Button which enables user to edit the line selected in the datagridview. There are also other controls on the form other than the two controls specified. I use a panel (Name : UpdateItemsPanel) containing various controls to edit the item selected... I want to display this form Modally... ie... When this form is active, user should not be allowed to access any controls other than the controls in the UpdateItemsPanel. I tried the following but got into other problems... If you can help me in solve either the main or one of these problems, it would be great help. I tried putting the contents of UpdateItemsPanel in a seperate form and show it as modal... The trouble was showing the update form as modal, blocks all other MDI forms also. Other problem with this 1 is, I need to position the modalform just below the PostedItemsDataGrid... I'm not sure How to do it... I tried putting the other controls in a panel and disabling the panel when updatepanel is displayed. This ofcourse, makes the (PostedItemsDataGrid) disabled and hence unable to scroll... Could you please help.... Please let me know, incase you need more info...

    Read the article

  • C#.NET How to access fields in user control dynamically?

    - by Conor H
    Hi, I'm making a settings screen at the moment that will have a radiobutton group which will determine what controls are displayed. The different settings are contained within a UserControl. I am dynamically creating this UserControl like so: panel = new btSettings(); this.Controls.Add(panel); panel.Location = new Point(15, 49); Just wondering how I can access the fields within this control and design time when the object will only be created during run time? Thanks.

    Read the article

  • How to solve the performance decay of a VB.NET 1.1 application?

    - by marco.ragogna
    I have single-thread windows form application written with VB.NET and targeting Framework 1.1. The software communicates with external boards through a serial interface, and it mainly consist of a state machine that run some tests, driven in a loop done with a Timer and an Interval of 50ms. The feedback on the user interface is done through some custom events raised during the tests. The problem that is driving me crazy is that the performance slightly decrease over time, and in particular after 1200/1300 test operations. The memory occupied does not increase over time, it is only the CPU that seems interested by this problem. The strange thing is that, targeting framework 2.0 and using the same identical code, I do not have this problem. I know that is difficult without looking at the code, but do you have suggestions how can I approach the problem?

    Read the article

< Previous Page | 48 49 50 51 52 53 54 55 56 57 58 59  | Next Page >