536 Posted Topics
Re: If your user does not have administrative rights then you might find that they cannot write to the file where the program is located. (A basic User account does not have write access to "[I]Program Files[/I]" and its sub-folders.) You should use the user's data folder to store user specific … | |
Re: My personal preference would be to use a single picture box (one for each hand) and do the image overlap in the paint event. However, as a beginner, you might find it easier to create you own custom cardHand control that overlaps the card image picture boxes. | |
Re: If you are creating the object in the method, then it is likely that it is being disposed when the method terminates, possibly before the sound has a chance to play. Try creating the object at a higher scope level and call the makeNoise method when you need to. | |
Re: I think the problem with your original code is that you are invoking on the UpBox class. This causes the invoke to execute on the thread that the UpBox is created. To update the listbox you should invoke on the listbox. Try this. [CODE] public void UpdateBox(ListBox list, string text) … | |
Re: I assume that the rich text box is contained in your custom ChatControl. If that is the case then it is with this object that you need to interact. If you add a message property to your ChatControl [CODE]public string MessageText { get { return this.richTextBox1.Text; } set { this.richTextBox1.Text … | |
Re: If each of your aliens is in a separate picturebox then they will never move at the same time. Each object will be refreshed in turn and this could be the reason why it looks like they overlap. Consider painting them in the form paint event handler instead of in … | |
![]() | Re: You can simplify the url null test if you use [iCODE]if (!String.IsNullOrEmpty(url))[/iCODE] Or [iCODE]if (!String.IsNullOrWhiteSpace(url))[/iCODE] |
Re: [QUOTE]<div>text</div>[/QUOTE] This is not the kind of RichText that the [I]RichTextBox[/I] accepts. That is more compatible with the [I]WebBrowser.DocumentText[/I] property (i.e. HTML). If you do not need the user to edit the text then try replacing the [I]RichTextBox[/I] with a [I]WebBrowser[/I]. Then use this to do the binding. [CODE]Binding bind … | |
Re: I think that what you are doing is better done in a method on the main form. This is a modified version of your CreateButton constructor as a method. [CODE] // Creates a new button with given text, name, location, and size // then adds to this form public void … | |
Re: The font size etc. of a windows form is controlled by the operating system settings. One way to overcome this is to create a frame-less form with you own custom title bar (and frame etc.) and manage all the user interactions yourself (click and drag to move the form etc.). … ![]() | |
Re: I think solution Taken from [URL="http://stackoverflow.com/questions/185648/dispose-of-image-in-wpf-in-listbox-memory-leak"]here[/URL] should work. [CODE] private void LoadMapImage(string filepath) { if (!string.IsNullOrEmpty(filepath)) { FileInfo info = new FileInfo(filepath); if (info.Exists && info.Length > 0) { BitmapImage bi = new BitmapImage(); bi.BeginInit(); bi.DecodePixelWidth = (int)Map.Width; bi.CacheOption = BitmapCacheOption.OnLoad; bi.UriSource = new Uri(info.FullName); bi.EndInit(); Map.Source = bi; } … | |
Re: You probably need to look at using the [I]DrawString [/I]overloads that have a [I]StringFormat [/I]parameter. This allows you to control the alignment of text within a rectangle (left,center,right; top, middle, bottom).:) [Edit] I find that using the [I]StringFormat.GenericTypographic[/I] format as a base, then adjusting the alignment properties appropriately works best. … | |
Re: As far as I can tell it is there because [I]Invoke [/I]needs a delegate. The invoke call on the dispatcher is causing progressbar to refresh. I think the Windows Forms equivalent is [I]progressbar.Invalidate()[/I]. It forces the progress bar to re-paint (render) itself; with the new value. If you don't like … | |
Re: This is very similar to your [URL="http://www.daniweb.com/forums/thread324279.html"]other thread[/URL]. I'll assume that this is about windows forms not WPF. The following code seems to do the trick. [CODE] private void LoadMapImage(string filepath) { if (!string.IsNullOrEmpty(filepath) && System.IO.File.Exists(filepath)) { if (Map.Image != null) Map.Image.Dispose(); Map.Image = Bitmap.FromFile(filepath); } } [/CODE] | |
Re: A listbox works the same whether the form is opened modal or modeless. Just access the properties and events as normal. | |
Re: The objects on each tab are [B]all [/B]available at the form level. Just reference them in what ever method or event handler code you need. | |
Re: You cannot break in to a Drag-Drop event and then continue it. This is because the focus is passed to the devEnv and the drag-drop ends. Instead, put Debug.WriteLine commands in your code to get diagnostic info on what is happening. | |
Re: When storing the value in the DB use dpSignedSO.Value.Date to only capture the date portion (actually the time is set to 00:00:00). (You could also do the same when setting dpSignedSO.Value from the DB just to be certain it has no time part.) | |
Re: I am sure you know already that if you wish to simulate a bouncing ball then you will need to do more than +10 to the coordinates. The correct way to draw to a form is to use the Paint event. Use the timer to adjust the coordinates and use … | |
Re: Never really paid it much attention before but my “weeks” go thus: [CODE=text] Date DoW days posts 13/05/2010 Thur 14 17/05/2010 Mon 4 23 24/05/2010 Mon 7 34 01/06/2010 Tues 8 37 08/06/2010 Tues 7 0 (?) 14/06/2010 Mon 6 78 (?) 21/06/2010 Mon 7 33 03/07/2010 Sat 12 37 … | |
Re: The null error could be because the key name is incorrect. Assuming that you cut & pasted the key name then you need to add a second \ after SYSTEM. [CODE] v LocalMachine\\SYSTEM\[COLOR="Red"]\[/COLOR]CurrentControlSet\\Control\\ComputerName\\ComputerName\\[/CODE] | |
Re: As far as the HTML code goes do you mean you want to have access to an HTML file created outside your program? If so then create the HTML and add it as a Resource to you project. Resources are merged in to the program and can be read by … | |
Re: Personally, I find the easiest way to restrict the user to numeric entry is to use a NumericUpDown control. This already has all the key checking built-in. You can also specify a maximum and minimum value to further validate the entry before processing. If you still wish to use the … | |
![]() | Re: Flying was a recurring dream (nightmare) that I sometimes had when I was a kid. It starts with me sliding down a banister, railing, roof or other slope. At the end, instead of landing hard, I just curl up in a ball and float off rising up and looking down … |
Re: You could read the values when the user presses a button. Or, you could capture the TextChanged event of MaskedTextBox controls. [CODE] private void add_groupbox(int x, int y, int id) { GroupBox gb1 = new GroupBox(); MaskedTextBox mtb1 = new MaskedTextBox(); MaskedTextBox mtb2 = new MaskedTextBox(); MaskedTextBox mtb3 = new … | |
Re: [URL="http://www.daniweb.com/forums/post1352472.html#post1352472"]This thread[/URL] might help. | |
Re: I have found that the controls you add to your [I]UserControl [/I]capture the mouse and do not pass the clicks on to the base control. You need to capture each of the child control click and double click events and pass them on. This code snippet shows how to do … | |
Re: You are using the NModbus ModbusSerialMaster. If I remember correctly this uses the serial port's timeout settings. Set port.ReadTimeout to a suitable value (in milliseconds). The ModbusSerialMaster will retry 3 times before failing with an exception. | |
Re: When I ran your code snippet I got a lot of zeros at the top left of the page. Which is the expected result as I made [I]arr[/I] an array of doubles. Your problem is somewhere outside the code you have provided. Possibly, page set-up means that the (0,0) location … | |
![]() | Re: Your description seems correct to me. The only thing I would like to add is that most events are managed using a MulticastDelegate. This is basically a collection of Delegates that are all called when the event is fired. A good way to describe a Delegate is as a "type … |
Re: Look at [URL="http://www.daniweb.com/code/snippet298708.html"]this snippet[/URL] from Ryshad (Dan). It might help. | |
Re: You might need to specify the full path in [iCODE]p.StartInfo.FileName = "lease_query.pl";[/iCODE]. E.G. [iCODE]p.StartInfo.FileName = "c:\\MyApps\\lease_query.pl";[/iCODE] | |
Re: Is this an ASP app or a Windows Forms app? How are you capturing the points? | |
Re: For help with understanding regular expressions I find theses pages useful. [URL="http://www.codeproject.com/KB/dotnet/regextutorial.aspx"]The 30 Minute Regex Tutorial - CodeProject[/URL] [URL="http://msdn.microsoft.com/en-us/library/az24scfc.aspx"]MSDN Regular Expression Language Elements[/URL] [URL="http://regexlib.com/Search.aspx"]RegExLib.com Search[/URL] | |
Re: To remove a form's title bar you need to set the [I]Form.Text[/I] property to [I]string.Empty[/I] and set the [I]Form.ControlBox[/I] property to false. Note: This also means there is no X close button, so make sure you have another way to close the form. | |
Re: One of Daniweb rules is [QUOTE]Do provide evidence of having done some work yourself if posting questions from schoolwork assignments[/QUOTE] If you have a coding problem then please post some code and someone will help you. | |
Re: You could do something like this. [CODE] private class paramData { public paramData(string name, SqlDbType type, object value) { Name = name; Type = type; Value = value; } public string Name { get; set; } public SqlDbType Type { get; set; } public object Value { get; set; } … | |
Re: You can use a [I]delegate[/I] and assign it the function you want to execute. A delegate is like a function pointer and you have probably already used them in the form of a [I]MulticastDelegate[/I] that are used by events. The following code snippet should explain how to use them. [CODE]class … | |
Re: The ####### in an Excel cell indicates that the data is too big to display in the cell. I think your problem is not the text formatting but the column width. | |
Re: I am not sure what it is supposed to do but [I]pointcolour[/I] is always returning 1.0f. [Edit] This means that [iCODE]if (h != alt)[/iCODE] is only true on the first iteration! | |
Re: If this is a Windows Forms app then this is the only way. If this is a WPF app then the RichTextBox (TextBoxBase) has BeginChange and EndChange methods to encapsulate multiple changes in to a single undo unit. | |
Re: Because int is not a reference class. foreach is for iterating through collections of reference objects. Change it to a for loop instead. | |
Re: When you are dragging (i.e. moving the mouse while clicked on an object) the MouseEnter event does not fire for the objects you pass over. Instead, the object first clicked receives MouseMove events, with the appropriate x,y coordinates and mouse button status. It might be possible to do what you … | |
Re: Also, change the 180 to 180.0. The compiler interprets 180 as an integer and 180.0 as a double. | |
Re: Are you sure [I]myAcct [/I]is not [I]null [/I]at this point? When your app breaks because of the error, hover over myAcct with your mouse. A tool tip will pop up with its current value. | |
Re: A simple way to do what you want is to use the Yes/No/Cancel option of the MessageBox and re-phrase your question. [CODE] private void button1_Click(object sender, EventArgs e) { string message = string.Format("Press Yes to Accept,{0}No to Retry.", Environment.NewLine); DialogResult Result = MessageBox.Show(message, "Is This OK?", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2); MessageBox.Show(Result.ToString(), … | |
Re: You could use a picture box (or panel, or other simple control) of height=1,width=1 as the 'dot' placed at the location clicked. Attach to the [I]Click[/I] event for the 'dot' control to run the form open action. When saving the points, just iterate through the form.Controls collection and get the … | |
Re: Well 42 is supposed to be the answer to Life the Universe and Everything. So maybe there will be total world enlightenment.:D | |
Re: My first instinct was to say test the [I]FullPath[/I] property of the [I]FileSystemEventArgs[/I]. But, since it has been deleted, it no longer exists!:@ Although no guarantee, you could test the [I]FullPath [/I](or [I]Name[/I]) property for an extension. If it is [I]string.Empty[/I] then it is probably a folder. | |
Re: You should be able to capture the TAB press and override the tab action. I had a go using four buttons and a few other controls on a form. Tab order was set to go from button1, button2, button3, button4 then on to other controls. The following code kept the … |
The End.