- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 5
- Posts with Upvotes
- 5
- Upvoting Members
- 4
- Downvotes Received
- 3
- Posts with Downvotes
- 2
- Downvoting Members
- 3
47 Posted Topics
Re: // make sure colomn headers are set to number of strings in listview // the first string will be the item while the second third and fourth are the sub items. // use the for statement will add new listview item with 3 more subitems [CODE]ListViewItem lvi = new ListViewItem(new … | |
Re: if (the value being passed == to code within the application) { this.methodGreat; } else { this.methodSucketh; } private double d; public double d2 {get{return d;}} What if the value being entered in a textbox has to be an double value? try { d = double.Parse(textBox1.text); this.DialgogResult = DialogResult.Ok; } … | |
Re: I have used this code in the past i have the complete source which i found on either codeproject or vckicks. I have used this method to create my own image format. here is how to load and save as image using this method. here is how to load the … | |
Re: [CODE] string[][] lines = new string[4][]; lines[0] = new string[] { "1", "a", "d" }; lines[1] = new string[] { "2", "b", "c" }; lines[2] = new string[] { "3", "c", "b" }; lines[3] = new string[] { "4", "d", "a" }; MakeDescending(lines[0]); foreach (string s in lines[0]) { MessageBox.Show(s); … | |
Re: [QUOTE=skatamatic;1597203]I wrote a trojan not that long ago that wasn't detected by my antivirus. It did incredibly suspicous stuff too, like sending a list of running procs over TCP or UDP to a listener, running procs, accepting commands to run in the command-line, remote shutdown/restart, send clipboard data back and … | |
Re: [CODE]static void main() { LoginForm login= new LoginForm(); if(login.ShowDialog() == DialogResult.OK) { Application.Run(new Form1(login.User, login.Pass)); } } public partial class Form1:Form { string _User,_Pass; public Form1(string user, string pass) { _User = user; _Pass = pass; } }[/CODE] | |
Re: DoubleClick On Properties in SolutionExplorer and change Target Framework. If there are any features that are not supported in 3.5 that's supported in 4.0 the the IDE will let you know | |
Re: To Store To ClipBoard read jmurph333's solution to retrieve clipboard text us Clipboard.GetText(); | |
Re: A quick suggestion? It's not a good idea to make controls public as it makes these controls accessible outside of the program if you insist on having a Control be accessible out side of that Form i would suggest using Internal over public as internal makes the controls accessible outside … | |
Re: [COLOR="Red"][B]LOL[U] Not going to happen[/U][/B][/COLOR] Programming takes time and practice. It's not something that you can read a book and be an expert on. Even the greatest of programmers still learn something new from time to time. I would suggest getting a good book and reading it. checking out tutorials … | |
Re: [QUOTE=CDeansy;1589757]I'm old school. For the planning i prefer just to use pen and paper.[/QUOTE] At least the paper can't be deleted :) | |
A Simple method to create a short url using google | |
Re: [QUOTE=jaskiratj;1589325]hello everyone.. 1)is there a way to print the data present in the griedview? 2)for the same, do we need to export the gridview data to excel for print purpose in web application? if yes, how to export that data... thank you[/QUOTE] Are you trying to print WebPage or GridView? | |
Re: [CODE] using System.IO; using System; namespace folder_information { public partial class folder { protected DirectoryInfo _Directory; public folder(string directory) { _Directory = new DirectoryInfo(directory); } //Function to get all the folders present in that particular location,Use public DirectoryInfo[] Directories { get { return _Directory.GetDirectories(); } } //Function to get all … | |
Re: [code]public void Save_File() { //creating an SaveFileDialog object, to save Excel File. SaveFileDialog dialog = new SaveFileDialog(); dialog.InitialDirectory = "c:/desktop"; dialog.Title = "Select Where To Save File"; dialog.Filter = "Excel Files (*.xls;*.xlsx)|*.xls;*.xlsx|All files (*.*)|*.*"; if (dialog.ShowDialog() == DialogResult.Cancel) return; // now you have to save the the file which you … | |
Re: [QUOTE=sandeepparekh9;1568904]public Image byteArrayToImage(byte[] byteArrayIn) { MemoryStream ms = new MemoryStream(byteArrayIn); Image returnImage = Image.FromStream(ms); return returnImage; }[/QUOTE] Great code but when passing back to image you can save one line of code like this [CODE]public Image byteArrayToImage(byte[] byteArrayIn) { MemoryStream ms = new MemoryStream(byteArrayIn); return Image.FromStream(ms); }[/CODE] | |
Re: the url should be something like videoplayback? blah blah blah but youtube has changed their api again which i havent figured out the new api just yet | |
Re: This project works ive used it in the past and is very well worth looking into [URL="http://www.codeproject.com/KB/audio-video/MP3Compressor.aspx"]MP3Compressor By Idael Cardoso[/URL] | |
Re: [QUOTE=khocmedemmua;1581992]At present, my source code project is in disk E, this is its path : [COLOR="Red"]E:\WindowsApplication1[/COLOR] In this folder has a folder Files, with path : [COLOR="Red"]E:\WindowsApplication1\WindowsApplication1\bin\Debug\Files[/COLOR] I have a form with a browse button to choose file, after choose file, it will save into folder Files automatically. My chosen … | |
Re: Haven't worked much with Server but when getting an image from a web url or byte[] the memstream will work good I prefer to use Bitmap so that I can set the size of the image. Heres a simple method to get image from a url. [CODE]Bitmap MyImage(string url, Size … | |
Re: [CODE]public class TripleDES_EncryptionDecryption { public static string EncryptTripleDES(string Data, string Password) { byte[] clearBytes = System.Text.Encoding.Unicode.GetBytes(Data); PasswordDeriveBytes pdb = new PasswordDeriveBytes(Password, new byte[] { 0x00, 0x01, 0x02, 0x1C, 0x1D, 0x1E, 0x03, 0x04, 0x05, 0x0F, 0x20, 0x21, 0xAD, 0xAF, 0xA4 }); MemoryStream ms = new MemoryStream(); TripleDES tsp = TripleDESCryptoServiceProvider.Create(); tsp.Key … | |
Re: [B]Alternative[/B]: This Alternative will allow you to set the fade effect with the [B][COLOR="red"]System.Windows.Forms.Timer.Interval[/COLOR][/B] value rather than using the Thread.Sleep method for a slightly better performance. On the [B][COLOR="red"]System.Windows.Forms.FormClosingEvent[/COLOR][/B], it cancels the close and redirects the close event thru the [B][COLOR="red"]System.Windows.Forms.Timer.TickEvent[/COLOR][/B]. There is also a built in ImageHandler that uses … | |
Re: Nice code, haven't checked but sure will work...but one question? if you want the panel to resize based on the forms size why make x,y int values public? The code is within the same form so there is no need to make the values public by doing so it allows … | |
Re: [QUOTE=niths;1560752]i already enabled multiline to true.. let me explain u clearly.. dnotes = XXXX; ndate = 1234; now in description Textbox my value is XXXX 1234 it is ok if i had only one value in dnotes and ndate if had another row like dnotes = YYYY; ndate = 9876; … | |
Re: Environment.NewLine will do the trick but to much headache. Instead of [CODE]writer.Write("this"+Environment.NewLine+"will" + Environment.NewLine + "make"+Environment.NewLine +"each" + Environment.NewLine + "word" + Environment.NewLine + "appear" + Environment.NewLine + "on" + Environment.NewLine + "a" + Environment.NewLine + "new" + Environment.NewLine+"line");[/CODE] Instead try using \r\n like this [CODE]writer.Write("this\r\nwill\r\nmake\r\neach\r\nword\r\nappear\r\non\r\na\r\nnew\r\nline");[/CODE] | |
Re: [CODE]private void button1_Click(object sender, EventArgs e) { Form form = new Form(); Label lbl = new Label(); form.Controls.Add(lbl); lbl.Location = textBox1.Location; form.Size = this.Size; lbl.Text = textBox1.Text; form.ShowDialog(); }[/CODE] | |
Re: I see that you type Debug/bin/path....Shouldn't it be bin/Debug/path | |
Re: [CODE]using System; using System.Drawing; using System.Windows.Forms; namespace WindowsFormsApplication1 { public partial class Form1 : Form { private Panel panel1 = new Panel(); private PictureBox box = new PictureBox(); private Panel closeButton = new Panel(); private bool moveable; private Point currentPosition; private Image img; public Form1() { InitializeComponent(); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; … | |
[CODE]using System; using System.Drawing; using System.Windows.Forms; namespace WindowsFormsApplication1 { public partial class Form1 : Form { private Panel panel1 = new Panel(); private PictureBox box = new PictureBox(); private Panel closeButton = new Panel(); private bool moveable; private Point currentPosition; private Image img; public Form1() { InitializeComponent(); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; … | |
Re: First of all, I would suggest using double instead of float because double can easily accept decimal point and when getting and Average it's not likely that the average will not have a decimal. Here is what I have I think it should work pretty well, I don't really know … | |
Re: [CODE]Form2 frm2 = new Form2(); this.Hide(); if (frm2.ShowDialog() == DialogResult.Cancel) return; /* here you can return values from form2 back to form1 if Form2 DialogResult is DialogResult.Ok but make sure that your accept button's Dialog Result is set to DialogResult.Ok or force dialogresult.OK if certain conditions are meet by this.DialogResult … | |
Re: [CODE]private string fn { get { string outstr = ""; string[] commands = Environment.GetCommandLineArgs(); if (commands.Length == 2) { outstr = commands[1]; } return outstr; } }[/CODE] to call the method just call like this [CODE]string s = fn;[/CODE] now do whatever you need with string s; | |
Re: [CODE] private Image ImageFromClipboardText { get { WebRequest req = WebRequest.Create(Clipboard.GetText()); WebResponse resp = req.GetResponse(); return Image.FromStream(resp.GetResponseStream()); } }[/CODE] | |
Re: What would be the point? Couldn't you just as easily on label click event do textbox1.text = label1.text? how about something that is not on the form that is being dragged into the control like a web image being dragged into a picturebox? | |
Re: [CODE] string str = "1 2 : 3"; string[] s = NewString(str).Split(','); foreach (string strings in s) { if (!String.IsNullOrWhiteSpace(strings)) { MessageBox.Show(strings); } }[/CODE] now the newstring method [CODE]private string NewString(string str) { string s = str.Replace(" ",","); return s.Replace(":", ","); }[/CODE] | |
Re: System.Dll should be one of the first Dll that the deisgner automatically inserts for you | |
Re: [CODE]private class EncryptionClass { public string Encrypt256(string Data, string Password) { byte[] clearBytes = System.Text.Encoding.Unicode.GetBytes(Data); PasswordDeriveBytes pdb = new PasswordDeriveBytes(Password, new byte[] { 0x00, 0x01, 0x02, 0x1C, 0x1D, 0x1E, 0x03, 0x04, 0x05, 0x0F, 0x20, 0x21, 0xAD, 0xAF, 0xA4 }); MemoryStream ms = new MemoryStream(); Rijndael alg = Rijndael.Create(); alg.Key = … | |
Re: Why not just save the information in xml format rather than txt?? Much easier to read as System.Xml.XmlTextWriter(this would be the write method) and System.Xml.XmlDocument(this would be the read method) Would Save You Alot of unnecessary coding. | |
Re: I have been trying to do the same thing I found source to connect via com port but have not understood how to access the comport. Here is the code that I came across I will post as attachment[ATTACH]20083[/ATTACH] | |
Re: Awesome Code Here is a slight touch up you might like [CODE]using System; using System.Threading; using System.Windows.Forms; namespace Chico { public class SingleApp { private static Boolean IsSingleAppMode; private static Mutex singleApp; private const Single waitTime = 3000; public static Boolean Initialize(Boolean value, Form form) { try { if (value) … | |
Re: Keep in mind that the system protects some files so you have to pay close attention to any errors. try using as try catch block so that you know what errors are being thrown. here is a simple method that i use to clear the internet cache in vista [CODE]using … | |
| |
Re: // set xml structure as such <Semester><Value Name="Semester1"/><Value Name="Semester2"/></Semester>etc.etc. System.Xml.XmlDocument doc = new Sytem.Xml.XmlDocument(); doc.Load("Path to Xml File"); foreach (XmlNode node in doc.SelectNodes("/Semester/Value")) { combox1.Items.Add(node.Attributes["Name"].innerText); } | |
Re: Code Snip, Also Know as a Code Snippet. Is A small Piece of Code That Can be used in Different Applications To Get A result. There is No Way to Know what the snippet was intentionnaly ment for it could be used for many things as to extract certain data … | |
Re: Your Webrowser is null because it is being called as a new webbrowser put your initial webbrowser outside of initial void like this: WebBrowser wb = new WebBrowser(); public void Form1_Load(object sender, EventArgs e) { wb.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(wb_DocumentCompleted); } wb_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) { // web browser is being … |
The End.