4,439 Posted Topics
Re: A ComboBox comes in three flavours. You just got to set the DropDownStyle property. DropDownStyle = ComboBoxStyle.Simple; This acts as a simple list(not what you want) DropDownStyle = ComboBoxStyle.DropDown; This is what you want, you can't edit. DropDownStyle = ComboBoxStyle.DropDownList; A list, and you can edit text. Hope this helps. | |
Re: Welcome to DANIWEB sardonic. When I close all my files in VS I get a gray rectangle and no tabs of course. When I doubleclick a .cs file in the solutions explorer I get a listing with a tab. I can choose in the View menu Other Windows and open … | |
Re: First know that the journey will be long but rewarding. You should download the free Visual C# 2008 Express edition if you not have already done so. On it's starting page it has a Getting Started section. | |
Re: What do you mean by [I]I want to box up the white pixels in the image using the rectangle. [/I]? Coordinates start in the upper left corner with (0,0). Y coordinates increase by moving down. X coordinates increase by moving left. | |
I'm using VS 2008 C# Express edition here. Try to use a CheckedListBox, which I think is just a fancy ListBox. In designmode I can set the property SelectionMode : None (? rather strange for what I think is a list of checkboxes) One MultiSimple MultiExtended When I select one … | |
Re: A few remarks: [COLOR="Green"]First:[/COLOR] CP_PB_Main is a bad name. You know what it means now, will you still know it in say 2 months? Give it a meaningfull name. [B]MyMostBeautifullPictureBoxEver [/B]is even better, although... [COLOR="Green"]Second:[/COLOR]You never say anything about the variable ClickPic, so I won't either. [COLOR="Green"]Third:[/COLOR] I believe you … | |
Re: Also had some issues with this sort of thing. Thanks for the tip Scott. Renaming is also a tricky thing to do. | |
Re: What have you tried for yourself so far? How would you start to tackle the problem? | |
Re: I never tried this but IMO it must be possible to manipulate Resources.resx with something like [url=http://msdn.microsoft.com/en-us/library/system.resources.resourcewriter.aspx]this[/url] I already used resources some 25 years ago, they were there from the beginning, on a Macintosh... | |
Re: Perhaps read [url=http://msdn.microsoft.com/en-us/library/ms379572(VS.80).aspx#datastructures20_3_topic3]this article[/url] | |
Re: [QUOTE=parthmishra]a application based project[/QUOTE] You already know it has to be an application! That is a good starting point for someone in his IT final. | |
Re: Do something like this in your button click: [CODE=c#]Form SecondForm = new Form(); SecondForm.Show();[/CODE] | |
Re: In addition to that : a root of a number cannot only refer to the square root, but also the cube root,... Nth root. To do this in C# you can do something like: [CODE=C#]double num = 8.0; double power = 1.0 / 3; Console.WriteLine("Cube root of {0} is {1}.", … | |
Re: Means little to me. She can probably also recite a whole telephone book if she wanted. Of course not everyone can do that (me included) If your mind is is gifted with the ability to video record a course of say 1000 pages you could pass any exam. It doesn't … | |
The Sort method of the List class sorts everything the default way : ascending. You can use the Reverse method of this class to get what you want or you could implement the IComparer interface like in this snippet. | |
Re: Nice for beginners. I too am still learning BTW. Hope you know there exists something like "Properties"... | |
The matrix class in .NET is not a full featured matrix class as mathematicians would like to see it, still you can do amazing things with it. Create a new windows form application. Fill in the code and you are ready to experiment. In the code I do something with … | |
Re: I will not complain. This is very good to start with, but if you like this sort of things, please try to learn more about it! That is if you can and if you want to. It can be a very exciting journey! | |
Although the DateTime structure in .NET has an IsLeapYear method. Lots of people in here like to do this on their own. See this snippet on how it can be done. This is in C# but other language adepts might benefit from it also. | |
Just a little snippet to check if a string contains only letters. | |
Re: Here,there and everywhere...all over the place, start a course on cooking spagetti. Stop programming if you want to continue on this way, else try to use a while loop. | |
Re: I WRITE this sentence now. Yesterday, I WROTE a letter to my friend. It WAS WRITTEN with a ballpen. | |
Re: Nice. But why make your a string global? Why not pass it to your fn_print() function! It would make it more portable. | |
While strolling around in the methods of the Graphics class, I bounced on the CopyFromScreen method. He, so why not make a screen capture utility! I know there is lots of this stuff out there. But it just seems like fun to try to make one myself. I made a … | |
Blink and you will see them appear in a Console window. This is a translation to C# of a Modula-2 implementation by N.Wirth, the inventor of Pascal. The tested integers are obtained by incrementing alternatively by 2 and 4, thereby avoiding multiples of 2 and 3 in the first place. … | |
Although there is little need for any sort algorithm in C#. Every collection class has a sort method, so why would you wanna write one for yourself? My guess to learn and see how it is done. Well her are implementations of two popular sorts. The arrays are integer but … | |
Re: Why use integer for diatomic, metal and transitional? These are clearly booleans and should be used as such. | |
You can make any color you like by setting the r, g and b values of a Color structure. But .NET has a set of predefined colors that you can use by name, so that you can simply set the backgroundcolor of a form with Color.LawnGreen for instance. Ever wondered … | |
Re: Nice! Have you read [url]http://www.daniweb.com/code/snippet979.html?[/url] Maybe you can test wich of the three is the fastest? | |
Visual Studio is a great tool to use. But for beginners like me a few years back, it was a bit overwhelming and confusing. You got the feeling you lost all the control. VS has it’s special ways of doing things with partial classes and so on. So lets get … | |
Re: Good try! When you XOR your input with a random number, what is the purpose of XOR'ing it with another random number a that same number of times?(See the lines after "Type something:" Do you think it will get more random? It won't get less decipherable. In fact you're XOR'ing … | |
Way back years ago I tried to understand [B]delegates[/B]. See the snippet how I did it. | |
Encryption has many issues. It can be very simple or very complex. I personally don’t have that many secrets, but when the company I worked for wanted to encrypt something I used the following : XOR ! What is nice about xor is that you can use the same method … | |
Class to convert between Celcius, Fahrenheit and Kelvin temperatures. Set one temperature and automatically get the other two. This class makes use of properties. See the code snippet for details. A short main program is added to exercise the Temperature class by printing a conversion table between celsius and fahrenheit. | |
This is the last part. This is the code that sets it al together and lets the parser and scanner do some work. Happy calculating! | |
Here is the second piece of code. The parser tries to interpret the tokens it gets from the scanner. | |
A bunch of basic statistical functions. I could have made a class here and I could have used more features of C#. But just to keep it simple I left it as a console application. So the modifications you have to make if you're into C, C++, Java etc. should … | |
If you ever want to get information about files stored in a particular map or directory, you can find out how it is done here. With a little modification you could turn this snippet into a DOS DIR-command or a UNIX(LINUX?) ls-command. | |
[TEX]Solve an equation of the form Ax^2 + Bx + C = 0.[/TEX] The class is commented, but if you have any questions don't be affraid to ask. You may exercise this class in a console application with the following snippet : [CODE]QuadraticEquation z = new QuadraticEquation(1, 3, 3); z.Solve(); … | |
OK Quicksort IS fast. But what if you just wanna sort 30 items? Then Quicksort becomes a bit of overkill. So what most people then use is the one and only popular "bubblesort", also called "standard exchange sort". Let me present you here with my implementation of another sort(among many … | |
Most of the time there are many ways to implement an algorithm. Here are two ways to implement the greatest common divisor algoritm, one of the oldest algorithms ever. | |
If you have to convert an angle from degrees to radians and way back, here are some utility functions in C#, along with a program to test them. I made use of the "out" keyword here, which allows a function to return more than one value. An alternative would be … | |
Re: LizR you are quite right using sqrt! But! Which is faster in the long run? Counting to the number or counting to the sqrt of the number? | |
Re: The FileInfo class has an Attributes property which may be of help? | |
Re: I think the OP meant more something like this: [CODE=c#]string msg = "RED ROSES AND A YELLOW ONE";//typed into textbox string needle = " A "; int offset = msg.IndexOf(needle); string before = msg.Substring(offset - 2, 2); string after = msg.Substring(offset + 3, 2);[/CODE] | |
Re: In C# strings are immutable, this may seem strange at first, especially if you come from C. Get used to it. The way to go in C# is: [CODE=c#]string s = "asdxpto123"; string lookupStr = "xpto"; bool test; test = s.Contains(lookupStr);[/CODE] In this case the boolean test will be true. … | |
Re: Two more remarks. 1) I would not call methods in the program class ad leave it as it is. Call methods in the Form class. 2) The string class already has a split method, so I would not invent my own, unless you find it fun to do so. But … | |
Re: Implement a MouseDown and MouseUp event handler to set a global boolean flag, to be checked by your timer handler method. | |
Re: What do you mean by working with a binary file? |
The End.