On my web form I have a text box, that when the form loads it get a string of text from a MySQL database and set the text box property as the string. So then you can edit the text. Then I have a button next to it that when you press it should put the text in the text box in to the database. But it never changes the information in the database. I think the problem might be to do with when I press the button it refreshes the page, therefor resetting the information in the text box and putting the original text back in to the database. Any help will be very much appreciated Thanks.
truly_pringled
Posts
-
Variable problem -
Needs some help with hit testingI am putting shapes in to a list array Then I use the code below to draw them on the forms background, I have this in the forms paint handler. foreach (Shape s in shapesArray) { s.Draw(g); } What I want to do is click on the form and a message box come up and saying true or false if the mouse point was in the shape. I have tried using the region command and isvisible but I can not get it to work how I want. Any help would be much appreciated.
-
Please help with problem – multiple audio file playback(c#)GOT IT WORKING! Thank you mav & dave. the code i used is below:- using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.Runtime.InteropServices; // for PlaySound() using Microsoft.Win32; // RegistryKey namespace WindowsApplication2 { /// /// Summary description for Form1. /// public class Form1 : System.Windows.Forms.Form { [DllImport("winmm.dll", SetLastError=true)] static extern bool PlaySound(string pszSound, System.UIntPtr hmod, uint fdwSound); [Flags] public enum SoundFlags : int { SND_SYNC = 0x0000, // play synchronously (default) SND_ASYNC = 0x0001, // play asynchronously SND_NODEFAULT = 0x0002, // silence (!default) if sound not found SND_MEMORY = 0x0004, // pszSound points to a memory file SND_LOOP = 0x0008, // loop the sound until next sndPlaySound SND_NOSTOP = 0x0010, // don't stop any currently playing sound SND_NOWAIT = 0x00002000, // don't wait if the driver is busy SND_ALIAS = 0x00010000, // name is a registry alias SND_ALIAS_ID = 0x00110000, // alias is a predefined id SND_FILENAME = 0x00020000, // name is file name SND_RESOURCE = 0x00040004 // name is resource name or atom } private System.Windows.Forms.Button button1; /// /// Required designer variable. /// private System.ComponentModel.Container components = null; public Form1() { // // Required for Windows Form Designer support // InitializeComponent(); // // TODO: Add any constructor code after InitializeComponent call // } /// /// Clean up any resources being used. /// protected override void Dispose( bool disposing ) { if( disposing ) { if (components != null) { components.Dispose(); } } base.Dispose( disposing ); } #region Windows Form Designer generated code /// /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// private void InitializeComponent() { this.button1 = new System.Windows.Forms.Button(); this.SuspendLayout(); // // button1 // this.button1.Location = new System.Drawing.Point(48, 56); this.button1.Name = "button1"; this.button1.Size = new
-
Please help with problem – multiple audio file playback(c#)Thanks for your reply I am using .net 1.1 The bits of code I have been using are shown below:- using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.Threading; using System.Runtime.InteropServices; private string currentSoundFileName; [DllImport("winmm.dll")] //load the sound libary public static extern long PlaySound(String lpszName, long hModule, long dwFlags); private Thread soundThread = null; public void PlaySoundInThread(string wavefile) { currentSoundFileName = wavefile; soundThread = new Thread(new ThreadStart(PlayASound)); soundThread.Start(); } public void PlayASound() { if (currentSoundFileName.Length > 0) { PlaySound(Application.StartupPath + "\\" +currentSoundFileName, 0, 0); } currentSoundFileName = ""; soundThread.Abort(); } Then I use the line below to play a wave file (i have stored the wav file in the debug directory) PlaySoundInThread("1.wav"); This works with one wav file but when I have tried to play another wave file after this, I just replete the line of code with a different wav file entered, and that's where my problem is, it does not work. Thanks RoB
-
Please help with problem – multiple audio file playback(c#)I am having a problem with trying to get a series of wav files to play, I just want a simple button that when you press it, it will play a list of wav files, so far all that happen when I try and do this is it will play the last audio file stated in the code several times (the amount of other files I have tried to play.) Any help that can be given will be much appreciated Thank you RoB