4,439 Posted Topics

Member Avatar for phoenix911

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.

Member Avatar for pilipino93
0
143
Member Avatar for sardonic

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 …

Member Avatar for sardonic
0
99
Member Avatar for thilinam
Re: C#

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.

Member Avatar for ddanbe
0
90
Member Avatar for learningthings

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.

Member Avatar for sknake
0
1K
Member Avatar for ddanbe

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 …

Member Avatar for chundachovis
0
413
Member Avatar for ctrl-alt-del

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 …

Member Avatar for sknake
0
135
Member Avatar for ak.royan

Also had some issues with this sort of thing. Thanks for the tip Scott. Renaming is also a tricky thing to do.

Member Avatar for ddanbe
0
90
Member Avatar for Mongz

What have you tried for yourself so far? How would you start to tackle the problem?

Member Avatar for sknake
0
175
Member Avatar for pilipino93

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

Member Avatar for DdoubleD
0
143
Member Avatar for wil0022

Perhaps read [url=http://msdn.microsoft.com/en-us/library/ms379572(VS.80).aspx#datastructures20_3_topic3]this article[/url]

Member Avatar for kvprajapati
0
141
Member Avatar for parthmishra

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

Member Avatar for ddanbe
0
143
Member Avatar for pilipino93

Do something like this in your button click: [CODE=c#]Form SecondForm = new Form(); SecondForm.Show();[/CODE]

Member Avatar for pilipino93
0
102
Member Avatar for polo_coins

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}.", …

Member Avatar for ddanbe
0
163
Member Avatar for happygeek

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 …

Member Avatar for barneykool
0
378
Member Avatar for ddanbe

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.

0
730
Member Avatar for mypicturefaded

Nice for beginners. I too am still learning BTW. Hope you know there exists something like "Properties"...

Member Avatar for ddanbe
1
141
Member Avatar for ddanbe

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 …

0
896
Member Avatar for tux4life

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!

Member Avatar for tux4life
0
177
Member Avatar for NicAx64
Member Avatar for ddanbe

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.

0
178
Member Avatar for ddanbe
0
814
Member Avatar for FlamingClaw

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.

Member Avatar for FlamingClaw
0
1K
Member Avatar for sahasrara

I WRITE this sentence now. Yesterday, I WROTE a letter to my friend. It WAS WRITTEN with a ballpen.

Member Avatar for ddanbe
0
120
Member Avatar for dileepkumar235

Nice. But why make your a string global? Why not pass it to your fn_print() function! It would make it more portable.

Member Avatar for dileepkumar235
0
176
Member Avatar for ddanbe

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 …

Member Avatar for ddanbe
0
3K
Member Avatar for ddanbe

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

Member Avatar for ddanbe
0
97
Member Avatar for ddanbe

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 …

Member Avatar for subtercosm
0
837
Member Avatar for MosaicFuneral

Why use integer for diatomic, metal and transitional? These are clearly booleans and should be used as such.

Member Avatar for ddanbe
0
253
Member Avatar for ddanbe

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 …

0
776
Member Avatar for vckicks

Nice! Have you read [url]http://www.daniweb.com/code/snippet979.html?[/url] Maybe you can test wich of the three is the fastest?

Member Avatar for MosaicFuneral
0
2K
Member Avatar for ddanbe

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 …

0
150
Member Avatar for MosaicFuneral

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 …

Member Avatar for MosaicFuneral
0
379
Member Avatar for ddanbe

Way back years ago I tried to understand [B]delegates[/B]. See the snippet how I did it.

Member Avatar for ddanbe
0
393
Member Avatar for ddanbe

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 …

Member Avatar for Ramy Mahrous
0
596
Member Avatar for ddanbe

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.

Member Avatar for ddanbe
0
2K
Member Avatar for ddanbe

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!

0
1K
Member Avatar for ddanbe

Here is the second piece of code. The parser tries to interpret the tokens it gets from the scanner.

0
1K
Member Avatar for ddanbe

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 …

1
479
Member Avatar for ddanbe

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.

0
220
Member Avatar for ddanbe

[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(); …

0
781
Member Avatar for ddanbe

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 …

Member Avatar for ddanbe
1
529
Member Avatar for ddanbe

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.

0
410
Member Avatar for ddanbe

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 …

0
344
Member Avatar for jesse_gador143

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?

Member Avatar for ddanbe
0
233
Member Avatar for serkan sendur
Member Avatar for serkan sendur
0
82
Member Avatar for KC Michaels

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]

Member Avatar for ryuslash
0
128
Member Avatar for msr

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

Member Avatar for msr
0
91
Member Avatar for akkkk

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 …

Member Avatar for akkkk
0
5K
Member Avatar for NargalaX

Implement a MouseDown and MouseUp event handler to set a global boolean flag, to be checked by your timer handler method.

Member Avatar for sknake
0
128
Member Avatar for TuX4020

The End.