Answer Questions
Adarsh123 Drawing parts of an Image
Hi - quick question. I need to use DrawImage/DrawImageUnscaled to draw certain source areas from a certain Bitmap, using a Graphics object, many times. I've tried many variations of the call and they all are very slow... 30~50 iterations takes almost a second. There's nothing I can do about the size of my image file either, unforunately. Making it a small-size PNG doesn't help at all. Also, I really want to avoid using DirectX here for the reasons of simplicity, load-up speed, and also the fancy advanced features like gradient brushes, etc. that I really need. So, to my actual question - is there any other way to greatly improve my speed without using another technology than GDI+ Thanks in advance... P.S. I should add that I can't reall ...Show All
R.Tutus WMI help! Confused!
Ok, I am using WMI to get the name of the network adapter on a users machine. Here is how I am doing this: ManagementObjectSearcher searcher = new ManagementObjectSearcher("Select Name from Win32_NetworkAdapter"); foreach (ManagementObject adap in searcher.Get()) { this.textBox1.Text = "Adapter Name: " + adap.GetPropertyValue("ProductName"); } Problem!!!!!!!!! --------------------------------------- it only returns a name of Packet Scheduler Miniport! ---------------------------------------------------- I tried changing this: adap.GetPropertyValue("Name"); to this: adap.GetPropertyValue("ProductName"); But then it jsut says that it cannot be found. ...Show All
Jon Brammeier DataGridView - what event fires when the grid is updated?
I need to perform a calculation on a DataGridView every time the contents of the grid change, like when a BindingSource.Filter is performed or when a row is added or deleted. Is there any way to hook this calculation into a DataGridView event that is called everytime the grid contents change I tried the Validation event and Layout event but they don't fire every time the contents change. TIA, Martin ...Show All
DevboyX chiled forms and parent form
hi, i make a parent form and inside it i will create chiled forms when i click button a new chiled form created till now every thing is ok my problem is i want all chiled froms which is created apperas in the same location look to this image in this site we find that all chiled forms not in the same location i want to make them appear in the same location http://www.codeproject.com/csharp/MDITabBrowsing.asp before calling the Show() method, set the StartPosition of that form, like this: frm.StartPosition = FormStartPosition .WindowsDefaultLocation; please ignore my last post....you should use this property instead frm.StartPosition = ...Show All
c_shah Opening / Closing Forms
Hey guys, Really simply, how do you open forms when you click a button! ! (i.e. in VB its docmd.open 'Form'). I just want to click a button and it pop up another form i have designed. Thanks in advance Tom You are initialising a new instance of frmFrontEnd there. you are only calling it frmPassword... Should it be: frmPassword myfrmPassword = new frmPassword (); my frmPassword.Show(); I think you're confusing yourself with the casing you're using. You're making it difficult to easily read what is a Class (first letter capital) and what is an instance (camelCase) hehehe ... story of my life. Yea, the code is all correct, it compiles etc but even ...Show All
Duncan Stewart Update fields upon saving
What would be the best way to update an editor and edit date column upon saving so that only rows that were changed would have those columns updated after the save. Is there a command that allows a specific cell in a datagridview to be set to a certain value. You may try the use the Controls collection to get a certain cell and set it value. Or if you bind the datagridview to a datasource, you can also change the value in datasource. Help this is helpful ...Show All
edle TabControl: Cancel Validating causes buttons on the tab page not responding to click event
Hi, I am working on a MDI windows application. On one of the childeren form, I have a tab control. when user try to jump from one tab page to another tab page, if there is change on current page, I need to use a message box to ask user to save change, and then use e.cancel = true to cancel the action. But this causes all the buttons on the tab page not responding to Click event, and also I cannot close the application. Does anyone know what is happening Thanks in advance. Cathie This is a known problem with the TabControl, check this thread ... The thread got locked somehow, not sure what's up with that; I unlocked it again. I'd give it a shot (Leave event) but doubt it wil ...Show All
eddy05 Scaling Windows Forms
Hi I've got a window with 2 panels (for video output), textbox and other controls. Now if I want to resize the window or change the resolution it does not scale. I read the following: http://msdn2.microsoft.com/en-US/library/ms229605.aspx but still don't know how to do it. Where can I find good examples Thank you! Hi, use the Dock property and set it to Fill to always resize a control to the size of its container. You could then use a SplitContainer as the outermost container in your form where it fills the complete form (Dock == Fill) and place two other controls in its left and right panel also with Dock == Fill. If you need more controls you could also put splitcontainer in splitcontainers ...Show All
TimMulholland User control-Design time support
i have created a user control and for this control one property is an object of a class named ControlProperties i have designed a form to accept certain values( essentily the controlproperty class object ) which are added to an hash list for design time support..my problem is i dont know how to assign perssist this object...i am getting this object during design time..but once i run this the object becomes null..i figured out that the object properties is not being included in the intialize compnent method.. here is what id did..to open the form during design time public class DesignSupport : UITypeEditor { public DesignSupport() { // // TODO: Add constructor logic here // } public o ...Show All
Ron L Handling different resolutions
Can anyone tell me how they handle writing apps for screens with different screen resolutions Some of my screens are set to be maximized, others aren't.. Is it possible Thanks tattoo Hi, You could also try checking the following link. http://msdn2.microsoft.com/en-us/library/system.windows.forms.control.dock.aspx Thank you, Bhanu. sorry the question isn't that clear - do you mean you wish to automatically resize your controls etc.... Sorry, What I am concerned about is if I develop an application on my machine that is using a certain resolution and then deploy this app to other machines where users are using different screen resolutions, potentially the s ...Show All
LiL_X WebBrowser Using CSS
I have a webbrowser control, and I am passing it the following data: string HTML = "" ; HTML += "<html><head><title>Test Page</title><link rel=\"stylesheet\" type=\"text/css\" href=\"Style.css\" /></head>" ; HTML += "<body>" ; HTML += "<h2>Hello there</h2><br />" ; HTML += "<table><tr><td><a href=\"\">Row1 Col1</a></td><td>Row1 Col2...</td></tr></table>" ; HTML += "</body>" ; HTML += "</html>" ; web.Document.Body.InnerHtml = HTML; This works fine, and the page disp ...Show All
Dario Galvani Move borderless Form problem
Hi, I created a borderless Form, and I tried to move this by MouseMove function I found some articles using Drag But I want to know what's wrong in my function My code is: private: System::Void display_Paint(System::Object^ sender, System::Windows::Forms::PaintEventArgs^ e) { if(img2){ e->Graphics->DrawImage(img2, 0, 0); this->Width = img2->Width; this->Height = img2->Height; } } private: System::Void display_MouseMove(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e) { if(mouseState==1){ if(Math::Abs(mouseX-e->X)>1||Math::Abs(mouseY-e->Y)>1){ int x = this->Location.X; int y = this->Location.Y; int newX = x + e->X - mouseX; int newY = y + e-& ...Show All
Sidambara raja Checked Items in DataGridViewCheckBoxColumn
Hi all, I have a DataGridView control binding with a DataSet, and a DataGridViewCheckBoxColumn is placed at the last column. Now, I want to get the checked items from this DataGridView and do other processes. Can you tell me how can I do this (E.g. loop all rows in DataGridView and then cast the CheckBox control, so that I can retrieve the value of the CheckBox as well as the values of cell[2] and cell[3].) Thanks, Peter No good: "Object reference not set to an instance of an object." FYI: The CheckBoxColumn is added dynamically: dgvcIsOutput.Name = "Column_Output"; dgvcIsOutput.Width = 50; &n ...Show All
Nilesh Meshram TreeView fails to display icons, why?
**also posted to VSTO form...no replies ** My VSTO Outlook add-in shows a form with a TreeView control. The tree works properly, showing the data I expect it to, but not the icon images. When I add a default root node in VS Designer and assign it an image from my ImageList, it appears correctly in the designer. When I run the add-in, the default node appears, but without icon. There was a related thread MSDN Forums Windows Forms Windows Forms General Icons not showing up on Treview on VSTO beta, but no real answer posted. Anyone have any ideas The debugger shows that the TreeView object does have the ImageList, and that the ImageList has the right number of images, and that the nodes have ImageIndex values in the prop ...Show All
Will Riley Capturing events in an ActiveX Controls...
Hi All, Is it possible to capture events of an Active-X Control in an HTML page, similarly to the onclick, onMouseOver events which we do for a HTM textBox etc. I need to capture an event from a Card Reader, and then parse the Card Track Data and fill my HTML TextBoxes. I would prefer to point the CarddataChanged event, in my object tag to a javascript which will populate my Textboxes. What should I do to have this kind of a functionality. What are the things which i need to keep in mind when I build my Active-X Control. Please Help, Thanks In Advance, Joe. Guys, I found it, we just need to set some properties in the activex control which we develope and then access them in our web page using ja ...Show All
