205 Posted Topics

Member Avatar for TrustyTony

I agree with you. I also faced the same problem. This cool new design is making ugly problems. :X

Member Avatar for TrustyTony
0
236
Member Avatar for Santi10_figo

You should save the default image of the picturebox and then use that image every time you draw graphics. I mean like this: [CODE] // Class-level variables Image defaultImage, gImage; public Form1() { InitializeComponent(); defaultImage = pictureBox.Image; } private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { // This will use the …

Member Avatar for Santi10_figo
0
1K
Member Avatar for jockfaire

[CODE]I would like to remove any selected item from the list box and not just the first item, which is what your solution does [/CODE] What do you mean with "any selected item"? Do you mean multiple selected items?

Member Avatar for finito
0
149
Member Avatar for kunwar1

You can use Array.Reverse() on a char[] array to achieve that. Here's an example: [CODE] string Reverse(string str) { char[] chars = str.ToCharArray(); Array.Reverse(chars); return new String(chars); } // Example use string text = "Some text goes here"; MessageBox.Show(Reverse(text)); [/CODE] Thanks

Member Avatar for farooqaaa
-1
34
Member Avatar for flasy12

[QUOTE=;][/QUOTE] The mistake you are making is that you are assigning the "rnd()" value to the TextBox's text every time the timer ticks. This code will work for you: [code] Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick [B]Dim rndInt as Integer = Int(Rnd() * 1)[/B] …

Member Avatar for flasy12
0
89
Member Avatar for Cap'nKirk

"Id" is an attribute not a tag. That's the mistake you are making. This code will work for you: [CODE]MessageBox.Show(photo[0].Attributes["id"].Value);[/CODE] Thanks

Member Avatar for Cap'nKirk
0
85
Member Avatar for khan17

You can get it like this: [I]int current[/I] holds the current index number. [CODE] int current = 0; // Get the "aaaa, bbbbb ...." HtmlElement pageElement = wb.Document.GetElementById("tableid"); this.textBox1.Text = pageElement.Children[current].InnerText); // Get the "hrefs" HtmlElement href = pageElement.GetElementsByTagName("a")[current]; MessageBox.Show(hrefs.GetAttribute("href")); [/CODE]

Member Avatar for khan17
0
1K
Member Avatar for krishnisilva

You've opened the connection after making the command. Try opening it before the command: [CODE] public void AddToAction() { [B]db.openConnection();[/B] String query = @"Select * from TopicAction"; SqlCommand command = new SqlCommand(query,DB.getConnection()); SqlDataReader reader = command.ExecuteReader(); SqlDataAdapter da = new SqlDataAdapter(command); DataTable dt = new DataTable(); da.Fill(dt); while (reader.Read()) { …

Member Avatar for sergb
0
147
Member Avatar for Cap'nKirk

You should add it to the Panel and not the Form. I mean you should use[icode]panel1.Controls.Add(pb);[/icode] instead of [icode]this.Controls.Add()[/icode] Thanks

Member Avatar for Cap'nKirk
0
983
Member Avatar for khan17
Member Avatar for khan17
-1
132
Member Avatar for discovery-power

Because you are not changing the [I]Text[/I] of the label controls. Try something like: [CODE] ScoreX += 1 ScoreO += 1 scoreXLabel.Text = ScoreX scoreYLabel.Text = ScoreY [/CODE] Thanks

Member Avatar for discovery-power
0
87
Member Avatar for anoop4real

Okay that looks a little bit confusing. But I think you can get it done like this: Firstly declare a class-level variable "ClickedLabel": [CODE] // Declare here Label ClickedLabel = null; public Form1() { InitializeComponent(); } [/CODE] Secondly add "MouseUp" event for the label OR make an event "AllLabels_MouseUp" and …

Member Avatar for farooqaaa
0
122
Member Avatar for Cap'nKirk

You can either make a new EventHandler or use a delegate. This will work: [CODE] pb.Click += delegate(object s, EventArgs e2) { System.Diagnostics.Process.Start("http://www.example.com"); }; [/CODE] Thanks

Member Avatar for Cap'nKirk
0
117
Member Avatar for krishnisilva

You can check it like this: [CODE] string[] ProposalNumbers = getProposalNumbers(); if (ProposalNumbers.Length > 0) { // Array is not empty } [/CODE] Thanks

Member Avatar for farooqaaa
0
82
Member Avatar for basma.lm

I don't get you. If you don't want to show Form3 then simple get rid of that code: [CODE] Form3 f = new Form3(); f.Show(); [/CODE]

Member Avatar for finito
0
108
Member Avatar for krishnisilva

You can use: [CODE] if ((string)dataGridView1.Rows[RowIndex].Cells[cellIndex].Value != string.Empty) [/CODE]

Member Avatar for bords
0
126
Member Avatar for dre-logics

Check your Command. You should pass the Connection as an argument. It should look like this: x = new Command("Select * From x", [B]Connection[/B]); Thanks

Member Avatar for dre-logics
0
372
Member Avatar for chaithan.p

Have a look here: [url]http://blogs.msdn.com/domgreen/archive/2009/09/06/comparing-two-images-in-c.aspx[/url] Thanks

Member Avatar for chaithan.p
0
129
Member Avatar for khan17

Use "InnerText" if you don't want those tags to show up: [CODE] textResult = pageElement.Children[0].InnerText; [/CODE] Thanks

Member Avatar for khan17
0
108
Member Avatar for jellybeannn

Try putting [icode]MessageBox.Show("Is this event even fired?");[/icode] to see if the event is fired or not. If the [I]MessageBox[/I] is not shown then try copying [icode]this.currency_txt.TextChanged += new EventHandler(currency_txt_TextChanged);[/icode] code to [I]public Form1() { ...(here)... }[/I]. Thanks

Member Avatar for finito
0
150
Member Avatar for GAME

You are making 2 mistakes. Firstly, you didn't save the Settings. Add this to the SaveProxies() method: [CODE] Share_Cash_Downloader_v0._2._9._5.Properties.Settings.Default.Save(); [/CODE] Secondly, you are loading the wrong settings. You are loading "Last" instead of "Proxies". Replace it: [CODE] string[] items = Share_Cash_Downloader_v0._2._9._5.Properties.Settings.Default.[B]Proxies[/B].Split(','); [/CODE] Thanks

Member Avatar for farooqaaa
0
117
Member Avatar for elizabeth mwash

Also, remember to add [icode]this.Hide();[/icode] after adatapost's code to hide the login form. Do the same for form2 if you don't want to use it when form3 is shown. Thanks

Member Avatar for finito
0
105
Member Avatar for krishnisilva

You can use: [CODE] public String[] FillComboBox() { int NoOfRows; String firstName; String lastName; db.openConnection(); DisplayLoginUserName(); String query = @"Select * From Employee;"; SqlCommand command = new SqlCommand(query, DB.getConnection()); SqlDataAdapter da = new SqlDataAdapter(command); DataTable dt = new DataTable(); da.Fill(dt); NoOfRows = dt.Rows.Count; String[] fullName = new String[NoOfRows]; for (int …

Member Avatar for farooqaaa
0
772
Member Avatar for UNOWN

Its pretty simple. First you'll store all the "a" tags in an HtmlElementCollection and then check each one if it StartsWith "http://www.googleads". If so, then add it to the links list. [CODE] List<string> links = new List<string>(); HtmlElementCollection col = webBrowser1.Document.GetElementsByTagName("a"); foreach (HtmlElement elem in col) { if (elem.GetAttribute("href").StartsWith("http://www.googleads")) links.Add(elem.GetAttribute("href")); …

Member Avatar for UNOWN
0
99
Member Avatar for Isoric
Member Avatar for krishnisilva

Edit your method and use "string[]" for the method type. Also use "return fullName;" instead of "return fullname[no]" because that will return a single string and not an array. Here's the working method: [I]Changes are in bold.[/I] [CODE] public [B]string[][/B] LoadUSEmp() { String firstName; String lastName; db.openConnection(); String query = …

Member Avatar for krishnisilva
0
3K
Member Avatar for KatyHex
Member Avatar for sidhu51

If you don't prefer to use Regular Expressions then this will also work: It doesn't use regex. [CODE] string abc = "SMS_dr_6500"; int num = int.Parse(abc.Substring(abc.LastIndexOf('_') + 1)); [/CODE]

Member Avatar for sidhu51
0
108
Member Avatar for krishnisilva

If the form - that you are trying to close - is the default form. Then closing it will also close the application. You should hide it instead of closing it. Just change [icode]this.Close();[/icode] to [icode]this.Hide();[/icode] You can use this to focus the username textbox: [icode]txtUsername.Focus();[/icode] Final code with all …

Member Avatar for rsodarith
0
150
Member Avatar for Learner7
Member Avatar for UNOWN
Member Avatar for UNOWN
0
2K
Member Avatar for krishnisilva
Member Avatar for krishnisilva
0
301
Member Avatar for walaa.z

You can use [I]for loop[/I] like this: [CODE]for (int i = 0; i < 10; i++) { forms[i].Contorls.Add(radiobutton); }[/CODE] Thanks

Member Avatar for walaa.z
0
93
Member Avatar for oXHutchXo

You can't make a game like that by using pictureboxes. Try using [URL="http://creators.xna.com/"]XNA Game Studio.[/URL]

Member Avatar for farooqaaa
1
46
Member Avatar for Flippers321

You are making one small mistake. Select your webBrowser in the designer. In the properties panel switch to "Events" and for "DoucmentComplete" event select the "webBrowser_DocumentComplete". OR you can do it via code: [CODE] webBrowser.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(webBrowser_DocumentCompleted); [/CODE]

Member Avatar for Flippers321
0
124
Member Avatar for pharrill

Use this to check if "pizzafoundboolean/stylefoundboolean" are true or not.: [CODE] ]If pizzafoundboolean And stylefoundboolean Then [B]MessageBox.Show(pricedecimal(indexinteger).ToString("C"));[/B] Me.pizzaTextBox.Text = pricedecimal(indexinteger).ToString("C") End If [/CODE] If the MessageBox() is not shown then none of them are true.

Member Avatar for pharrill
0
91
Member Avatar for DrueY

[QUOTE]The textbox is textBox1 and Ive got a lot of code connected to it[/QUOTE] Events? or the name "textBox1" ? Thanks

Member Avatar for kvprajapati
0
2K
Member Avatar for krishnisilva

To select the text of a TextBox when it is activated by Tab key. Then add "Enter" event for the textbox and use this code: [CODE] private void textBox1_Enter(object sender, EventArgs e) { textBox1.SelectAll(); } [/CODE] And to select the text when the textBox is clicked then add a "Click" …

Member Avatar for ch_shoukat222
0
132
Member Avatar for NPDA
Member Avatar for Alexpap
0
829
Member Avatar for krishnisilva

Set "AllowUserToAddRows" and "AllowUserToDeleteRows" to "False" and "EditMode" to "EditProgrammatically" to make it read only. Add "CellClick" event and use this code: [CODE] private void DGV_CellClick(object sender, DataGridViewCellEventArgs e) { if (dataGridView.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString() != string.Empty) form2.Show(); } [/CODE] Thanks

Member Avatar for manoj kumar1446
0
177
Member Avatar for oXHutchXo

Try this code: [CODE] using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace WindowsFormsApplication1 { public partial class Form1 : Form { int carX = 230; int carY = 230; public Form1() { InitializeComponent(); this.KeyDown += new KeyEventHandler(Form1_KeyDown); } private void Form1_Load(object …

Member Avatar for oXHutchXo
0
125
Member Avatar for sweetypie123

I don't have VB.NET installed at the moment. Anyway, try this: Change the [I]Modifiers[/I] property for the listview to "public" and then try to access it from form2 like this: [icode]Form1.listView1[/icode] An example for selecting the current selected item: [CODE]Dim selectedItem as ListViewItem = Form1.listView1.SelectedItems[0][/CODE] Thanks

Member Avatar for sweetypie123
0
98
Member Avatar for PierlucSS

You will have to use Invoke() method when calling something outside the thread. Use this: [CODE] this.Invoke((MethodInvoker)delegate() { inTreeNode.Nodes.Add( tNode2 ); }); [/CODE] Thanks

Member Avatar for PierlucSS
0
1K
Member Avatar for paul9998

You didn't proved the full path of "HELLO.txt". Lets say, if its located in "C:\" then use this: If so, then use this: [CODE] FileStream(@"C:\HELLO.txt", FileMode.Open,FileAccess.Read); [/CODE] Or if its located in the same path as the executable. Then use this: [CODE] FileStream file = new FileStream(Path.Combine(Application.StartupPath, "HELLO.txt"), FileMode.Open,FileAccess.Read); [/CODE] …

Member Avatar for paul9998
0
135
Member Avatar for Cap'nKirk

You can use Application.StartupPath: [CODE] System.Diagnostics.Process.Start("iexplore.exe", System.IO.Path.Combine(Application.StartupPath, "abc.html")); [/CODE] Thanks

Member Avatar for Cap'nKirk
0
94
Member Avatar for TechSupportGeek

Its simple: [CODE] ElseIf Saved = True Then 'This will overwrite it RichTextBox1.SaveFile(SaveFileDialog1.FileName, RichTextBoxStreamType.TextTextOleObjs) Me.Text = "" & SaveFileDialog1.FileName & " - NoteEditor Pro" End If [/CODE] If the file is already saved then path is already there. Just copy the code used in "Saved = false" but only remove …

Member Avatar for TechSupportGeek
0
176
Member Avatar for chipbu

Interesting question. Took me about 30 minutes to get this done. Here's the code: [CODE=C#] private char[,] Swap(char[] array) { // Make a list from the given char[] array List<char> fromArray = new List<char>(); foreach(char chr in array) fromArray.Add(chr); // This list will hold the new shuffled array List<char> randomList …

Member Avatar for farooqaaa
0
209
Member Avatar for thecoolguy

It can be done like this: [CODE] void CopyAll(DirectoryInfo currentDir, DirectoryInfo newDir, string fileType) { foreach (FileInfo fi in currentDir.GetFiles(fileType)) { fi.CopyTo(Path.Combine(newDir.ToString(), fi.Name), true); } foreach (DirectoryInfo subDir in currentDir.GetDirectories()) { DirectoryInfo targetDir = newDir.CreateSubdirectory(subDir.Name); CopyAll(subDir, targetDir, "*.txt"); } } [/CODE] Example Use: [CODE]CopyAll(new DirectoryInfo(@"C:\txts"), new DirectoryInfo(@"D:\newTxts"), "*.txt");[/CODE] Thanks

Member Avatar for thecoolguy
0
84
Member Avatar for Cap'nKirk
Member Avatar for krishnisilva

Put this in the Form_Load event: [CODE] bool value = Bool.Parse([B]put that value here[/B]); if(value) { checkBox1.Checked = true; } [/CODE] Thanks

Member Avatar for farooqaaa
0
89

The End.