374 Posted Topics

Member Avatar for OsheRono

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 …

Member Avatar for Geekitygeek
0
200
Member Avatar for Rohith Reddy

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.

Member Avatar for Geekitygeek
0
101
Member Avatar for DanielaCrisan

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 += " …

Member Avatar for Diamonddrake
0
151
Member Avatar for DAVe3283

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 …

Member Avatar for Geekitygeek
0
817
Member Avatar for DaveTran

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 …

Member Avatar for Geekitygeek
0
133
Member Avatar for jonnod123

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.

Member Avatar for Diamonddrake
0
88
Member Avatar for CanYouHandstand

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 …

Member Avatar for Diamonddrake
0
134
Member Avatar for Diamonddrake

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) …

1
58
Member Avatar for ejazmusavi

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 …

Member Avatar for Diamonddrake
0
576
Member Avatar for Egypt Pharaoh

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]

Member Avatar for ddanbe
0
81
Member Avatar for Rageagainst20

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.

Member Avatar for kplcjl
0
7K
Member Avatar for globalarchitect

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 …

Member Avatar for globalarchitect
0
431
Member Avatar for ticktock

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 …

Member Avatar for Diamonddrake
0
263
Member Avatar for Diamonddrake

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 …

Member Avatar for Diamonddrake
1
135
Member Avatar for MxDev

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]

Member Avatar for MxDev
0
89
Member Avatar for rocco_h

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 …

Member Avatar for Diamonddrake
0
1K
Member Avatar for blackblizzard
Member Avatar for Raj2786

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 …

Member Avatar for Diamonddrake
0
122
Member Avatar for thegreymatter

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 …

Member Avatar for kvprajapati
0
175
Member Avatar for pkinoc

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]

Member Avatar for herbie643
0
531
Member Avatar for MattBerry

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?

Member Avatar for Diamonddrake
0
110
Member Avatar for herbie643

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.

Member Avatar for herbie643
0
115
Member Avatar for welshe200

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 …

Member Avatar for Geekitygeek
0
101
Member Avatar for Medic873

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 …

Member Avatar for Geekitygeek
0
86
Member Avatar for Eternity[LK]

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 == …

Member Avatar for Geekitygeek
0
2K
Member Avatar for Bernybon

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 …

Member Avatar for Diamonddrake
0
141
Member Avatar for milosz

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 …

Member Avatar for kvprajapati
0
16K
Member Avatar for Yamazaki

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 …

Member Avatar for Diamonddrake
0
110
Member Avatar for gambit_1607

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 …

Member Avatar for Geekitygeek
0
423
Member Avatar for RoyMicro

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. …

Member Avatar for lee.j.baxter
0
493
Member Avatar for subcom

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 …

Member Avatar for logiccool
0
3K
Member Avatar for educated_fool

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.

Member Avatar for educated_fool
0
194
Member Avatar for KeenLearner2010

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 …

Member Avatar for Diamonddrake
0
1K
Member Avatar for mpegjohn

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 …

Member Avatar for Diamonddrake
0
179
Member Avatar for charqus
Member Avatar for Diamonddrake
-2
72
Member Avatar for Cory_Brown

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 …

Member Avatar for privatevoid
0
132
Member Avatar for GoS-ExiGo

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 …

Member Avatar for Diamonddrake
0
105
Member Avatar for mnf

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 …

Member Avatar for Diamonddrake
0
3K
Member Avatar for Romil797

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 …

Member Avatar for Diamonddrake
0
302
Member Avatar for Kligham

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 …

Member Avatar for Diamonddrake
0
364
Member Avatar for makdu

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 …

Member Avatar for makdu
0
5K
Member Avatar for MasterPengwin

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 …

Member Avatar for Diamonddrake
0
162
Member Avatar for crazyboy

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 …

Member Avatar for dkhil
-1
459
Member Avatar for jamesonh20

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]

Member Avatar for jamesonh20
0
146
Member Avatar for MxDev

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.

Member Avatar for mikah
-1
238
Member Avatar for zeeven

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, …

Member Avatar for zeeven
0
90
Member Avatar for Diamonddrake

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 …

Member Avatar for Diamonddrake
0
243
Member Avatar for Diamonddrake

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. …

0
767
Member Avatar for medopunsher

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.

Member Avatar for Geekitygeek
0
160
Member Avatar for kobi

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.

Member Avatar for ddanbe
1
155

The End.