2,157 Posted Topics

Member Avatar for Zanduar

First I'd like to say that these sites most likely won't like you doing this. You will have to make a lot of requests on their servers to keep prices up-to-date and they'll see this as either a DOS attack or contrary to their business desires (they don't want you …

Member Avatar for Zanduar
0
254
Member Avatar for techlawsam
Member Avatar for zachattack05

Tag is your best bet. As for determining which one was selected, it's easy:[code]private void radioButton_CheckChanged(object sender, EventArgs e) { RadioButton rb = sender as RadioButton; }[/code] 'rb' is the one that was selected. You can now access all its properties, etc. without actually knowing which one it is :)

Member Avatar for zachattack05
0
214
Member Avatar for sachintha81

It happens because you changed the text. I'd handle this by using this code:[code]Boolean shifted = false; private void textBox1_PreviewKeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.LeftShift || e.Key == Key.RightShift) { shifted = true; } else if (shifted == true && e.Key == Key.D4) { e.Handled = true; …

Member Avatar for Momerath
0
1K
Member Avatar for rotten69

[code]public string HumanChecker(string str) { if (str == this.RandomNumberGenerator()) { return "You are a human."; } else { return "You aren't a human!"; } }[/code] You do realize that this code is going to generate a new random number and that the odds that it will match what the person …

Member Avatar for kplcjl
0
182
Member Avatar for yash_shukla
Member Avatar for kplcjl
0
108
Member Avatar for zachattack05

It should run as long as you don't exclude them (use x86 or any CPU, not x64) and the .NET framework that you are using is available for that OS.

Member Avatar for zachattack05
0
121
Member Avatar for pseudorandom21
Member Avatar for Kezuino

It's bad design for one form to manipulate the controls on another form. Your second form should send a message (event) to the first form so it can manipulate its own controls.

Member Avatar for Momerath
0
184
Member Avatar for kapojian

What type is this [icode]GlobalClass1.globaldate = reader["start_date"].ToString();[/icode]?

Member Avatar for kapojian
0
139
Member Avatar for CSharpUser

Take a look at [URL="http://weblogs.asp.net/scottgu/archive/2008/01/07/dynamic-linq-part-1-using-the-linq-dynamic-query-library.aspx"]this[/URL].

Member Avatar for CSharpUser
0
301
Member Avatar for anwaryp
Member Avatar for adam_k
-1
155
Member Avatar for CSharpUser

Try something like this [code]var contList = (from c in contDoc.Descendants("Content") where (string)c.Attribute("Type") == str select c into ctemp where (string)ctemp.Attribute("Codec") == "H264" select new { Id = (string)c.Attribute("Id") }).ToList();[/code]

Member Avatar for CSharpUser
0
2K
Member Avatar for pivotcity

IsNullOrWhiteSpace is a static method so you use it by class.method, i.e. [code]if (String.IsNullOrWhiteSpace(movie_title)) { Console.WriteLine("You must enter a movie title, noob!"); } else { // they entered a title, do whatever you want here }[/code]

Member Avatar for pivotcity
0
296
Member Avatar for pivotcity

You could also just use the fallthrough on the case statement:[code]switch (response) { case 'm': case 'M': // code here break; etc... }[/code] And you have way to much code in your case statements. Make those methods.

Member Avatar for Singlem
0
3K
Member Avatar for JudeV

[code]private void button1_Click(object sender, EventArgs e) { int w = pictureBox1.Size.Width; int h = pictureBox1.Size.Height; int count = 23; Bitmap b = new Bitmap(w, h, System.Drawing.Imaging.PixelFormat.Format32bppArgb); w /= count; h /= count; Graphics g = Graphics.FromImage(b); for (int i = 0; i < count; i++) { for (int j = …

Member Avatar for Momerath
0
1K
Member Avatar for kiran.madke

Then you aren't very good at using google [url]http://yetanotherforum.net/[/url]

Member Avatar for niyitanga
-2
175
Member Avatar for Singlem

You can put a panel on the form, put all the first page controls on it, put another panel and put all the second page controls. Then hide whichever panel you won't want to display.

Member Avatar for nick.crane
0
129
Member Avatar for Hendo

You should read [URL="http://msdn.microsoft.com/en-US/library/ms173084%28v=VS.80%29.aspx"]Deploying C# Applications[/URL]

Member Avatar for Momerath
0
131
Member Avatar for techlawsam

{} indicates a block of code so the compiler knows that it ends when it reaches a closing }. ';' is used to mark the end of a statement so the compiler knows that you are done with that statement since C# ignores white space (except where significant). You could …

Member Avatar for Momerath
1
143
Member Avatar for techlawsam
Member Avatar for barnum

Set the OutputAssembly property of the CompilerParameters object to the location and name you want to use.

Member Avatar for barnum
0
149
Member Avatar for ddanbe

A recursive method using non-subtractive roman numerals:[code]using System; using System.Text; namespace ConsoleApplication1 { class Roman { String[] digits = { "", "i", "ii", "iii", "iiii", "v", "vi", "vii", "viii", "viiii" }; public String Convert(int number) { String result = String.Empty; if (number >= 10) { result = MultiplyBy10(Convert(number / 10)); …

Member Avatar for gracefull
0
1K
Member Avatar for zhackon
Member Avatar for zhackon
0
58
Member Avatar for king03

Arrays are numbered from zero up, so your line 6 creates an array with elements [0] and [1]. That should be enough for you to fix your problem.

Member Avatar for king03
0
93
Member Avatar for bangor_boy
Member Avatar for maninaction
0
219
Member Avatar for bhagawatshinde

Not sure what the problem is. Clicking on button6 adds a click handler for button7. Clicking on button7 should fire the handler.

Member Avatar for bhagawatshinde
0
9K
Member Avatar for delbari

Line 11 will never be true for any value that is not a power of two. Because of this you never will reach line 13 for these values so the value of 'f' won't change. You then, in line 51, call the method again [I]with the exact same value you …

Member Avatar for delbari
0
208
Member Avatar for SoftwareGuy

Well if you disable the control, of course it isn't going to have events as it's [B][I]disabled[/I][/B]. MouseClick does fire for ReadOnly, so not sure what your problem is there.

Member Avatar for hericles
0
2K
Member Avatar for rotten69

You can just stop the service, copy all changes (exe and dlls if any) and start it back.

Member Avatar for rotten69
0
142
Member Avatar for destruct0

[QUOTE=destruct0;1628130]WindowsForm windowsForm = new WindowsForm(); windowsForm.Show(); It shown for a moment after that the form closes itself.[/QUOTE] Provide the whole method that is in. I suspect the method ends right after the Show, which makes the variable windowsForm go out of scope, which closes the window.

Member Avatar for sknake
0
162
Member Avatar for coroll
Member Avatar for destruct0

[CODE]private void textBox1_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == (char)Keys.Enter) { textBox1.Select(0, 0); } }[/code]

Member Avatar for Momerath
0
394
Member Avatar for jasonmrc

Using a regular expression is easier: [code]if (Regex.Match(textBox.Text, @"^\d{6}[mg]$").Length > 0) { // it's a good ID number }[/code] This expression requires that there be 6 digits followed by either an 'm' or a 'g'. That is also the only thing allowd ("123456mt" doesn't work, where it would work with …

Member Avatar for rikthefrog
0
111
Member Avatar for ramanjot1620

That means it can't find that assembly. Do you have it installed? Where is it installed? Is it part of the GAC?

Member Avatar for Momerath
0
138
Member Avatar for Hendo

1) Yes 2) [URL="http://msdn.microsoft.com/en-us/library/system.diagnostics.process.start.aspx"]Process.Start()[/URL] No free ones that I know of, but there is [URL="http://www.tangiblesoftwaresolutions.com/Product_Details/CSharp_to_CPlusPlus_Converter_Details.html"]this[/URL].

Member Avatar for gusano79
0
201
Member Avatar for king03

You want to limit the number of checked items in a CheckedListBox. What property of CheckedListBox tells you what is checked? Once you have that, is there some way to Count them?

Member Avatar for mshauny
0
133
Member Avatar for tapandesai007
Member Avatar for zachattack05

Pull the datasource into some collection (List<T> comes to mind) and add your item then bind the list to the control.

Member Avatar for zachattack05
0
179
Member Avatar for bangor_boy

It is possible to use character frequency statistics to help crack the 'name' cipher. All you need to do is divide the encrypted text into three groupings (since we know the key is three characters long), determine the frequency of each group and XOR the highest frequency in each group …

Member Avatar for Momerath
0
134
Member Avatar for Srcee
Member Avatar for Momerath
0
45
Member Avatar for tr6699
Member Avatar for king03

In general you can't declare methods inside methods (multiply is inside main). And you can have private classes, no matter what Mitja says :)

Member Avatar for Mitja Bonca
0
89
Member Avatar for king03

First Question: Those are static methods. Also known as class methods. Second Question: That's not a constructor. Constructors don't have a explicit return type, while this one does (double).

Member Avatar for Momerath
0
152
Member Avatar for mrjimoy_05

Line 19 says if you have an error loading the file, you ignore it. This may be the source of your problem. If you are going to put a 'try' block, catch an exception! Display something. I suspect it is failing there and _flashCard (who ever told you naming variables …

Member Avatar for Momerath
0
126
Member Avatar for king03

MessageBox is a Winform object. Based on the 'ConsoleApplication10' I'd say you are writing a Console application, thus, no MessageBox. If you want output, use Console.WriteLine. Oh, and there is no recursion anywhere in that code.

Member Avatar for Momerath
0
158
Member Avatar for mrjimoy_05

Here is an example using a label and two buttons [code]using System; using System.IO; using System.Windows.Forms; namespace WindowsFormsApplication1 { public partial class Form1 : Form { String[] theText; int position = 0; public Form1() { InitializeComponent(); theText = File.ReadAllLines(@"D:\My Workspaces\Windows Phone 7 Solution\SimpleFlashCard\EnglishFlashCard.txt"); if (theText.Length < 1) throw new FileLoadException("There …

Member Avatar for nick.crane
0
1K
Member Avatar for thompsonSensibl

This is not the Knapsack problem as you only have one constraint (volume). Calculating value/cm3 is easy: You have value/gram and gram/cm3. Multiply the two and you get value/cm3 (the grams cancel). Sort high to low (or use the Heapify function of [URL="http://en.wikipedia.org/wiki/Heapsort"]heapsort[/URL] which would be faster, but probably overkill …

Member Avatar for Momerath
0
86
Member Avatar for king03

Add a handler to the SelectedIndexChanged[code]private void checkedListBox1_SelectedIndexChanged(object sender, EventArgs e) { int i = checkedListBox1.SelectedIndex; checkedListBox1.SetItemChecked(i, !checkedListBox1.GetItemChecked(i)); }[/code] This does have an issue that it's now harder to unselect an item :)

Member Avatar for king03
0
100
Member Avatar for srikanth2321

[URL="http://msdn.microsoft.com/en-us/library/aa365247%28VS.85%29.aspx"]Characters allowed[/URL] Use any character in the current code page for a name, including Unicode characters and characters in the extended character set (128–255), except for the following: [LIST] [*]The following reserved characters: [LIST] [*]< (less than) [*] > (greater than) [*] : (colon) [*] " (double quote) [*] / …

Member Avatar for Ketsuekiame
0
705

The End.