Answer Questions
Debralour Writing a picturebox to a file using .jpg format
I have a picturebox with text that was added using the DrawString method. The text can be seen on the display. I now want to: 1. Save the picturebox to a .jpg file. 2. Send the picturebox to a printer (directly, not from the .jpg file created in #1). Can someone show me how to do these two steps Thank you. I tried that and got an unhandled NullReverenceException (on the image object, I believe). I never created an image object in the pictureBox. I just did the following to display the text in the pictureBox. String line; // Read, display lines from file until eof reached Graphics g = pictureBox1.CreateGraphics(); g.Clear( Color .White); Point p = new Point (5, 5 ...Show All
Klaxas Dropdown List
Is there a way to make a Dropdown List typing enabled in a web application. Thank you in advance Thank you for answering, I would like to have it populated from the database and it should function almost like intelli-sense. I have a developed the intelli-sense, but it still has some bugs in it, so i was thinking of going the cheap way out :) What happened ..Did it work The rule here is that IE is the standard, so besides us, no one should use firefox :) Thank you very much and you have a good nite :) oh thank you very much...But i can see that u wrote ActiveX controls which work only in IE(as far as ...Show All
Burd Ending Backgroundworker
I'm just wondering if there are any specific functions that should be called from within the BackgroundWorker process in order to clean it up properly, or if you can just let it exit like a normal function No, you simply exit the DoWork event handler like any other function. The BackgroundWorker itself must be disposed but that's something you do from the thread that created the background worker in the first place, not from DoWork. If you added a BackgroundWorker to your form using the designer there is no need to dispose it, the generated code will take care of it. Thanks Mike. ...Show All
redneon Fatal Execution Engine Error when working With Form in Design View
I have an application in VS2005 using XP Pro that hangs when I click on a particular form in design mode. The form has a tabControl with multiple TableAdapters. The application compiles and runs fine but I cannot click on the form in development. I've even tried in SafeMode with no success. I've tried on different machines with no success. What is wrong here Below is my error: .NET Runtime version 2.0.50727.42 - Fatal Execution Engine Error (7A2B45A2) (0) Hanging application devenv.exe, version 8.0.50727.42, hang module hungapp, version 0.0.0.0, hang address 0x00000000. as near as we can figure it has to do with serialization of the controls. Code is written behind the scenes that does not ...Show All
RomanAnanyev start/stop windows services through coding
How to start/stop an existing windows service through coding by a button click anyone have any code/links/idea plz help Hi, Here is an article that shows you how to do it: http://www.codeproject.com/csharp/Service_Controller.asp Greetz, Geert Geert Verhoeven Consultant @ Ausy Belgium My Personal Blog ...Show All
Sqnyy .net 2.0 visual style
Hi, I am using winforms .net 2.0 It seems that the visualStyle does not have any effect on the controls looks. for example a button looks as if you are using .net 1.0 Any thoughts please Probably. There's no way to tell what, you haven't given us any information beyond "it doesn't work". With VB.NET: Project + properties, Application tab, turn on Enable XP visual styles. With C#, ensure your Main() function in Program.cs looks like this: [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); } This is what I have in program.cs Could it be because my Form1 is mdiPar ...Show All
Bianca_it app.config - turn off machine.config inheritance?
Hi, I have an app.config for my windows app and the first time a user runs the app after installation I want to check whether a connectionString has been set up - if not, I get them to point to their SQL Server & database, write the connectionString to the connectionStrings section of the .config file and away I go. The app is designed to work with multiple connection strings. The problem I have is that when I first run the app and there are no connectionStrings in the app.config, the connectionstring count is still 1 because (I assume) it is inheriting the machine.config. How can I leave the machine.config alone but turn off inheritance Many thanks James ...Show All
Matt Lin How to create and Invisible Groupbox
I am creating an application for a Tablet PC that has a flash movie playing in the background and looks for input from the user (from a writing area I have defined in a groupbox on the main form). I am curious how to make this groupbox invisible but still usable so that I can show it and unshow it without anyone knowing the difference and it will still collect the pen input. Thanks! While it seems like it should be working... its not. To see what I'm talking about: open a new C# windows application, put a flash object in the main form so that it covers the entire form background and then put a groupbox over it and try to set the transparency. I have tried a variety of things to get it to just show the flash object but nothing has wo ...Show All
pushpraj TreeView - Drag & Drop - Need some help formatting it
I have a TreeView that uses Drag Drop. The only problem is that I have no way of telling where these are going. When you select a node, it gest highlighted. But when you drag it, it does not underline, highlight or do anything before you drop it. So it's hard to see where you're dropping the node. What do I need to do so users can see where they're droping things Thanks. Here's the code I use (after it's created): //Global private TreeNode NodeToBeDeleted; private System.Drawing.Point Position = new System.Drawing.Point(0,0); private void tvPackages_ItemDrag(object sender, ItemDragEventArgs e) { NodeToBeDeleted = (TreeNode)e.Item; string strItem = e.Item.ToString(); DoDragDrop(strItem, DragDro ...Show All
jvillwock How to adjust MDI forms size according to screen size...?
Hi... In my MDI application , Before loading my parent form i want to check my screen size & according to that i want to adjust my MDI parent & child form size. In my application, I have a child form which is always active & which is covering the parent forms area. For that I want to adjust my parent form & that child forms area according to the screen size. How I can do this in C#... Thanks & regards, Vinay Try this in your MDI parent: private void Form1_Load(object sender, EventArgs e) { this.Location = Screen.PrimaryScreen.WorkingArea.Location; this.Size = Screen.PrimaryScreen.WorkingArea.Size; } Hi... Thanks... But with ...Show All
Ali.Badakhshan Include the parent control when a child is cut / copied and pasted.
Hi all, This is the final step in what became a rather involved process. The big picture is that I need to present a container control at design-time which does NOT clip its children. So yeah, I want for instance a child button control to be able to draw beyond its parent's bounds. I've gotten it to work by implementing an "envelope / hub" mechanism, where the hub is the above-mentioned container, and the envelope is its parent, another container which sizes itself to envelop the hub. When the user needs to "float" (ie. un-clip) the child button, it gets re-parented to the envelope and now has free reign to paint over the hub's bounds. All that to say, I have one final problem: when the hub is cut to clipboard, ...Show All
MattFletcher ClickOnce falied to copy setup.exe - already exists
I have set up a VB 2005 OneClick deployment for my latest and greatest software (well, latest...) When I click publish, then finish, I get the error: Failed to copy file 'C:\My Documents\CustomDelivery\CustomDelivery\bin\Release\CustomDelivery.publish\setup.exe' to '\\share\CustomDelivery\setup.exe'. Unable to add 'setup.exe' to the Web. The file 'setup.exe' already exists in this Web. I've searched all over and all I found was something about a beta version. When I go to help > about it tells me I have: Microsoft Visual Studio 2005 Version 8.0.50727.42 (RTM.050727-4200) Check that you don't have a file added twice in your project. (eg. in your references and listed in your solution explorer) ...Show All
Larrybird02744 Column header painting - text margins
Hi, By default, there seem to be 6 pixels between the column divider and the first letter of a column header. I'm trying to reproduce the exact look & feel of another application, which has 3 pixels in its grid headers. So I need 3 pixels, (left and right), not 6. Is there an easy way of setting this I looked at the FAQ, which had a section on "Row Pre Paint and Post Paint". I'm not familiar with GDI painting, is there any simple code I can use to get this effect I don't really have time to try myself at the moment... Thanks! Hi,goPlayer Try handling the cellPainting event to owner draw the column header text, private void dataGridView1_CellPainting( object sender, DataGridViewCellPaintingEventArgs e) { ...Show All
varunsagii Who captures mouse events for disabled ToolStripMenuItems?
One of the features for my current application is to launch a context menu whenever the user right-clicks any control or menu item. This menu contains several methods one of which is supposed to pop up a message box to the user indicating why a control/menu item is disabled. For disabled controls I just capture the MouseClick event at its container ( GroupBox, TabPage etc ) and then use the location of the event to determine what control was clicked on by the user. For disabled ToolStripMenuItems I can't figure out who gets the mouse click ( MouseUp actually ). It doesn't seem to be handled by the menu strip or the window the menu is on. Can anybody tell me where/what should be handling this event Does it just get lost because the menu it ...Show All
Duncan Stewart How to set scrollable TextBox into bottom position if it has multiple lines.
I use a multi-line scrollable (vertical) Textbox to display some error messages during processing. I append error message into Textbox one by one. But the Textbox always display the top 10 messages when error messages are more than 10 lines. How can I set to the button line Thank you very much~ I guess you could do something like : TextBox1.SelectionStart = TextBox1.TextLength TextBox1.ScrollToCaret() ...Show All
