- Strength to Increase Rep
- +11
- Strength to Decrease Rep
- -2
- Upvotes Received
- 186
- Posts with Upvotes
- 152
- Upvoting Members
- 72
- Downvotes Received
- 4
- Posts with Downvotes
- 4
- Downvoting Members
- 3
I worked in Japan for Mitsubishi Electric as an applications engineer for 5 years. After returning to the UK I worked as a software engineer for Procon Engineering Ltd. writing custom end-user programs for weighing applications.My coding experience started…
- Interests
- Coding, Reading, Games.
Re: The default Checkbox field export value is "Yes". Did you try this? | |
Re: I see that the timer event is [I]"Time2_Tick[B]_1[/B]"[/I] with a 1 at the end. This usually occurs when an event handler is created again for the same object. Is [I]Time2_Tick_1[/I] used for the original alarm time event? Note: Using [iCODE]if (DateTime.Now == value)[/iCODE] might not trigger as the times are … | |
Re: The [I]BackColor [/I]of a form is set to [I]SystemColors.Control[/I]. This is also found in [I]SystemPens.Control[/I] and [I]SystemBrushes.Control[/I]. The actual color is dependant upon the windows color scheme or even the users theme. To put this color on to an image open the image as an [I]Image [/I]or [I]Bitmap [/I]then draw … | |
Re: The Form1.resx file is used by visual studio to store resources for the form e.g. the background image. Add another resource file for your own resource. The easiest way to do this is to use the Resources tab on the Project properties. | |
Re: Try this [CODE] byte[] data = new byte[2]; data[0] = 0xFE; data[1] = 0xFF; short value = System.BitConverter.ToInt16(data, 0); [/CODE] | |
Re: [QUOTE=antnotex;1632417]sorry for my english the problem is this: when you set the ComboBox.Text with the value wich is not in the collection ComboBox.SelecteValue is set to Nothing but BindinSource.Position holds last value, when you cancel the operation you set BindingSource.Position = "Previous Value" but BindingSource.Position is already set to "Previous … | |
Re: The [I]SelectedItem[/I] is not dependant upon the items checked state. In a [I]CheckedListBox [/I]the [I]SelectedItem [/I]is the one the being clicked. To test if it is checked or unchecked you must call the [I]GetItemChecked[/I] function with the [I]SelectedIndex[/I] property. This returns true if the item is checked, false otherwise. [CODE]if … | |
Re: Try these links. [URL="http://msdn.microsoft.com/en-us/library/ff649643.aspx"]MSDN - Model-View-Controller[/URL] [URL="http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller"]Wikipedia - Model-View-Controller[/URL] [URL="http://social.msdn.microsoft.com/Forums/en-US/modelingandtools/thread/eecc7b01-cee0-4c20-9086-b1c4cafa6709"]MSDN Architecture Forum - MVP and MVC patterns[/URL] | |
Re: adatapost answered this for you already. [URL="http://www.daniweb.com/forums/thread290049.html"]http://www.daniweb.com/forums/thread290049.html[/URL] | |
Re: At first glance your code seems fine. (Except for the lack of error handling.) What errors are you getting? What is "IBGSDraw"? The cast should be of the same type as shapes. Which, from how you described you structures, I presume is List<IDraw>. Is IBGSDraw of type List<IDraw>? | |
Re: The ErrorCode=-2147467259 = 0x80004005 means "Unspecified Error" - Not much help.:( "...at System.Drawing.Icon.Initialize(Int32 width, Int32 height) at System.Drawing.Icon..ctor(Type type, String resource) at Microsoft.Xna.Framework.WindowsGameWindow.[B]GetDefaultIcon[/B]()..." This bit of the error message would suggest that the problem is to do with the default Icon. :?: Have you configured a default Icon? | |
Re: What do you intend to do during the scan? If you are looking for changes then you could use a *FileSystemWatcher* to do the "scanning" for you. | |
Re: You need to keep the serial port at the form level, otherwise the port is closed and disposed at the end of the button1_Click method. You also need to capture the incoming data (usually an "OK" from a Modem.) The following (untested) code should help. [CODE]namespace Sending_SMS { public partial … | |
Re: The method you are using to play the sound is OK. The following code works fine for me. [CODE] byte[] result = System.IO.File.ReadAllBytes(@"C:\WINDOWS\Media\ding.wav"); System.IO.MemoryStream ms = new System.IO.MemoryStream(result); SoundPlayer sp = new SoundPlayer(ms); sp.Play(); [/CODE] Have you checked that there is data in [I]result[/I]? How are you putting the data … | |
Re: When you open the second form also disable the menustrip button. Attach a method to the new form's [I]FormClosed[/I] event that enables the button. The sample below is for a toolstripbutton but the pattern is the same. [CODE] private void toolStripButton1_Click(object sender, EventArgs e) { toolStripButton1.Enabled = false; Form1 frm … | |
Re: I would suggest that you use the [iCODE]SelectedRows[/iCODE] property. [CODE]Me.DataGridView1.SelectedRows = dataGridView1.Rows(0)[/CODE] But test that there is at least one row first. | |
Re: If the data is stored in a dataset (filled using DataAdapter.Fill) then you can also use the DataAdapter.Update method to delete the removed records. This will also update any changed records and add any new records to the DB. | |
Re: [QUOTE=Momerath;1642852]So you won't see any changes persisted to the database.[/QUOTE] Actually, if the database file in the project is marked as [I]"Copy if newer"[/I] then it will only overwrite the copy in the Debug folder if you make changes to the database structure. Also, the changes you make while running … | |
Re: How are you getting the path to your[I] applicationSettings.data[/I] file? Is this a hard coded text path like this [iCODE]appdatapath = @".\Application Settings folder\applicationSettings.data";[/iCODE]? Or perhaps you use [I]Environment.CurrentDirectory[/I] as the base path? If so perhaps you should consider the following [URL="http://www.csharp-examples.net/get-application-directory/"]Get Application Directory [C#][/URL] and [URL="http://msdn.microsoft.com/en-us/library/ms229654(v=vs.90).aspx"]MSDN How to: Get … | |
Re: Some indication of what you have tried would be helpful. Is this a windows forms application or some other flavour of C#? It seems the DLL is written by you. Is this correct? What is calling the DLL and how? Is ComputeNN dependant upon the results of PrepareData? | |
Re: Try changing the listbox item value instead of using Add and RemoveAt. e.g. [iCODE]listbox1.Items[sl-1] = percent.ToString();[/iCODE] | |
Re: On the command line the "<" and ">" are used to redirect the input and output streams. You need to tell the process to do the same. This is not tested but will point you in the right direction. [CODE]private void mymethod(FileInfo file) { // set up ProcessStartInfo with redirected … | |
Re: You all seem to have far too much spare time! I look forward to all solutions as they will undoubtedly demonstrate some new technique that I can admire (and copy;)). | |
Re: You all have missed the key point in the original question. The fact that the OP is a [B]beginner[/B]! Here is a basic program that demonstrates the use of the [I]if else[/I] command. [CODE]static void Main(string[] args) { Console.Write("Enter a number: "); int iNum = 0; // read a value … | |
Re: You can use the CellFormatting event to do this. The following code snippet colours cells in the third column if they have a value of "-1". [CODE] private void dataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) { var cell = dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex]; if (e.ColumnIndex == 2 && ((string)cell.Value) == "-1") { e.CellStyle.ForeColor = Color.Red; … | |
Re: Line 57 is where the problem is. Here you are directly referencing only the first PictureBox with index of j=0. You need to convert [I]sender[/I] in to a picture box and use that instead. Try this. [CODE] if (System.IO.File.Exists(imgshow) && sender is PictureBox) ((PictureBox)sender).ImageLocation = imgshow; [/CODE] This adds a … |