374 Posted Topics
Re: I think I get what you are talking about. :) The best way I know to use a combo box is to bind it to an enumeration. [URL="http://www.blackwasp.co.uk/BindComboBoxToEnum.aspx"]Bind Combo Box to Enum[/URL] That's a great link to get you started. Then when you want to retrieve the value and use … | |
Re: this isn't very clear. But with only this information i would say check the file extensions on the path. if its .PDF then obviously, and if its .jpeg, .gif, .png, .bmp, ect. then its an image. | |
Re: In a for loop you have to use a local variable that you create in the first part of the loop. you cannot use a variable created somewhere else. if you want to use vars created somewhere else use a while loop. [CODE] while(i < n) { textBox2.Text += " … | |
Re: Some thoughts on this: 1) When using multiple forms for 1 application, its advantages to use MDI. Most users like to feel they have control over what they are doing and a bunch of floating forms can be scary if they don't behave the norm. Typically the "Main" form is … | |
Re: That's up to you or whoever reviews your code. If you write apps alone. Its whatever is easiest for you. Personally I order code by relevance. I create some regions and put similar things together. I put the private variables and the public properties that expose them right next to … | |
Re: Create a Static Class and make the method static. Then at any time in the application you simply call it [ICODE][I]Classname[/I].[I]Methodname[/I]([I]parms[/I]);[/ICODE] . that easy. | |
Re: Library extensions written in C# are good when the programs using them will be written in VB, C#, or C++.net. I don't think it would go well if you tried to use it will Delphi as C# libraries are managed code compiled to an IL that requires a virtual run … | |
I need to count the ticks from a simple switch attached to a gauge. The time it takes from the first detected tick to the 20th is the important data. To acquire the cycling on and off of the switch i have come up with 2 serial port techniques. 1) … | |
Re: This is a fun project. So long as you stay away from zooming and panning nothing gets complicated. Programming is a lot more than knowing how the code works. Its more important to understand the process you are trying to emulate. Ryshad has already pointed out you need a collection … | |
Re: This will do a negative effect on a color vector. But a true invert needs to be done with either HSL color space or a ColorMatrix. [CODE] Color InvertAColor(Color ColorToInvert) { return Color.FromArgb((byte)~ColorToInvert.R, (byte)~ColorToInvert.G, (byte)~ColorToInvert.B); } [/CODE] | |
Re: Application.Run(form) doesn't return until the form is closed. So it would actually be a perfect place to end any background threads started with an application scope. Although you may still want to join the threads just to make sure that the background thread as stopped before the Main method returns. | |
Re: Port 80 is the default port used by HTTP servers. only 1 program at a time can be the daemon of a local port. that's basic sockets 101. And by default on many XP installations there is a web server running. you might consider using a different port. unless you … | |
Re: The CultureInfo class holds culture-specific information, such as the associated language, sublanguage, country/region, calendar, and cultural conventions. This just creates an array of cultureInfo classes by asking the system for all that it knows about, then attempts to extract a string from that object representing the culture's country. The line … | |
I am working on a really fun project. I have written much of a program that lets you use a RockBand or GuitarHero drum kit to play drum sounds on your PC, record, playback, ect. I have decided conclusively as I add features I need more than just a gui … | |
Re: That is a complicated question presented so innocently. I will recommend this life changing programming book to anyone, and everyone. It doesn't focus on language but on theory and expresses what's important in software design and producing useful and reusable code. [URL="http://www.pragprog.com/the-pragmatic-programmer"]The Pragmatic Programmer[/URL] | |
Re: What you want to do here is check the "MIME" type of the file. This is saved into the file in the header. Internet explorer does this to know what to do with a file, and Windows media player does this to know what code to use to render a … | |
Re: Thanks for sharing! | |
Re: Threading is a very complicated thing, and you can't access a control from another thread than the one it was created on which is almost always the GUI thread, or the thread that is started when the application runs. The best idea here is to build a application modal that … | |
Re: IF you create a new form with the borderstyle set to none and have it accept a GridView in the constructor you can pass an instance of a gridview control that is created on the main form but not added to it. Then the new form can be animated in … | |
Re: If you want to emulate the same functionality as the red x and allow form closing events to work properly use, [icode] this.Close();[/icode] | |
Re: I don't see how it would relate to the monitor as points are points and widths are widths regardless of aspect ratio. have you tried compiling the code without changing it on another computer. to see it is definitely the computer in question? | |
Re: have you tried [I]control[/I].Capture = false; ? ref .NET Framework Class Library [B]Control..::.Capture Property[/B] Gets or sets a value indicating whether the control has captured the mouse. | |
Re: This could very easily be written in C# but I don't think its a good idea for an internet cafe as you would be violating the privacy of the users. You wouldn't see the passwords but you would see everything else. You would have to tell the users they were … | |
Re: you can do this easily. if you capture the entire screen as an image then just loop through it using the bitmap class's getpixel method and comparing it to the specified color, then saving its location in the image and moving the cursor location to those points. I don't see … | |
Re: The arrow keys are processed differently as they are caught by the form its self. So in order to do this you must override that method that catches them. [CODE] protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { if ((keyData == Keys.Right) || (keyData == Keys.Left) || (keyData == … | |
Re: Most likely you have a router that is blocking your port. also its a good chance you don't have a static IP and your IP address is changing. The server must be directly exposed to the net by forwarding the port it uses from your router to the local IP … | |
Re: since you always clear the controls on the panel first, seems like it will always be the only control on the panel, so [ICODE]panel2.controls. clear(); [/ICODE]should work. but you could also use[ICODE] panel2.Controls[0].Remove();[/ICODE] seems like there could be several ways to go about it. you could even expose the panel2 … | |
Re: I personally have no scrape with MS ACCESS as aside from changing the connection string the code is all the same. C# is perfect for this project. Just to clear it. C# can do everything VB can, and any VB code can be converted to C# very simply. there are … | |
Re: Passing data between forms is probably the first noob question asked here, search the forum you will literally find HUNDREDS of posts about it, google it you will find Dozens of answers. Typically done with properties. you could also use a class with static members, or even pass data through … | |
Re: Icons for menu strips are 16px X 16px, and this is the default size for the Imagelist control. Standard application icons contain 16x16, 32x32, 48x48 and in Vista and Win 7 they added 256x256. Tool bar icons are also typically 16x16 But the developer has complete control over that decision. … | |
Re: There seems to be an error, you use filearray like a string when it should be used as an array. and your for loop does the same thing over and over again, it should be [CODE] string[] fileArray = Directory.GetFiles(sourcePath); string fileName = null; for (int i = 0; i … | |
Re: if you just need to play 1 sound at a time try [URL="http://www.daniweb.com/code/snippet253704.html"]http://www.daniweb.com/code/snippet253704.html[/URL] i posted this snippet a while back, its async and works great, but if you play another sound it will stop the first sound. so just one sound at a time. | |
Re: Firstly, you are not specifying a path for your text file, just a file name, this is bad and can lead to an error. you should always specify a full path. this write the data to a text file, then loads it back and uses its contents to fill the … | |
Re: using the async load of the picturebox will work to an extent but eventually you will have loaded a ton of full size pictures into memory unnecessarily slowing down the system. alternatively you should consider creating a control from scratch that asynchronously reads the images from disk and creates a … | |
Re: It's not that it's an event, it is that it is a delegate. A delegate is a pointer to other methods. A delegate can point to an unlimited amount of methods and when you call a delegate you call all its appointed methods. Its used so at compile time the … | |
Re: I included a zip of the classes I decompiled from System.windows.forms that is used by the combobox. I couldn't find a definite answer to what was responsible for drawing the focus rectangle but it appeared that it send a windows message to the system and windows draws it. I couldn't … | |
Re: Processors these days perform 4 instruction sets for ever tick of the crystal oscillator from the system clock. If anything its not the processor. I would say its a limitation on the .net virtual machine sand boxing all the code it executes. If the OP seriously need accuracy at less … | |
Re: You didn't include the code for the FilgraphManagerClass so that makes it hard to determine a solution. But since you are just playing the video and not trying to do anything else with it I would consider using managed directx audiovideoplayback library. It has a video object that is very … | |
Re: There is a problem with this, very seldom will there be only 1 pixel of a particular color anywhere, It is very l likely that you will get hundreds of coordinates with even an unpopular color as many images contain millions of colors to make up and image. but I … | |
Re: In vista and win 7 so long as User Account Control is turned on you will be prompted, a much better approach would be to check if the current app is running as an admin and if not request that it is, then restart it, then check again, that way … | |
Re: if all you need is 1 key, then a simple hotkey would serve very nicely. First Import the native methods you need. [CODE] //API Imports [DllImport("user32.dll", SetLastError = true)] public static extern bool RegisterHotKey( IntPtr hWnd, // handle to window int id, // hot key identifier KeyModifiers fsModifiers, // key-modifier … | |
Re: This is not my area of expertise, but I think I can give you some ideas if anything. A good start would be developing a client/server type application, the server would run on the computer you want controlled, or accessed from the outside, the client would be a standalone app … | |
Re: This is very unclear, A better explanation would help to get a better answer but to resize a control you just set its width, and height via those properties [CODE] //example pictureBox1.Width = 200; pictureBox1.Height = 200; [/CODE] | |
Re: the rich text box has a [ICODE]Lines[][/ICODE] property, all you need to know is the line number and you can get the entire lines text via that property array. get that line number however you like, via mouse position or whatever you feel. | |
Re: well, you could create your own custom drawn group box control, that will take a screenshot of the full opacity groupbox and then set all of its childcontrols visibility properties to false, and draw the image of its full state in a loop of degrading opacities til it is blank, … | |
Just because I was bored one day I looked on the net for an app that would let me use my RockBand ps3 drum kit on the PC. There was a fancy direct X app out that turned out to be very buggy, slow, and annoying to use. I set … | |
I needed a way to buffer into memory an entire wav sound file to be played back a moments notice, as if for a game. So i created this class, simple instantiate it by passing to it a string and a bool indicating if you should buffer it to memory. … | |
Re: Shouldn't be anything more complicated than [CODE] Form1 F = new Form1(); F.Show(); F.SetDesktopLocation(Cursor.Position.X, Cursor.Position.Y);[/CODE] if you use Control.MousePosition you will have to convert pointtoscreen. | |
Re: if your file is large, you might think about threading it. or, if you load the file in a loop, then just add Application.DoEvents(); in the loop. |
The End.