536 Posted Topics
Re: Why not have an index file (or Dictionary class object) containing JobID and folder names. Then the folder names could be anything you want. When the service passes you a JobID, look it up in the index. If it is not there then create a new folder and add it … | |
Re: There is nothing wrong with the way you are starting the threads. What are you doing in [I]modem1_start [/I]and [I]modem2_start[/I]? Try breaking the execution in Debug and look at what code is executing. This can sometimes give a clue as to why it is hanging. | |
Re: Put the button in to an array and use the value from the TextBox as an index in to the array (-1 of course). | |
Re: If you have not solved this yet then you need to do something like this: [CODE]private void FileMenuItemClick(object sender, EventArgs e) { // get reference to clicked object ToolStripMenuItem barMenu = sender as ToolStripMenuItem; // test if object is ok and has a menu id if (barMenu != null && … | |
Re: The [I]sender [/I]object is the object that was clicked. You need to cast it to the [I]Label [/I]control class to use it. e.g. [CODE] private void label_Click(object sender, EventArgs e) { Label label = sender as Label; if (label != null) { // do something with label label.Text = "You … | |
![]() | Re: If all the stars are to move in the same direction you could use a background image and slide it in the appropriate direction, adding a random set of stars in to the newly created empty space. If you are looking for a 3D vanishing point effect then you will … |
Re: Assuming A and B are classes and in the same process then why not do it the other way around. Instead of B setting the picture in A, have A get the picture from B and set the picture box itself. Pseudo code might be: Main program create A. A … | |
Re: The problem is most likely due to the compared times having a resolution of minutes and your timer tick executing every second. This means that for a whole minute the comparison is true. [Edit] You might solve this by changing the string format to "HH:mm:ss" to include the seconds. Try … | |
Re: You will need to extract the field values from the parameter object to set the fields in the new object. More like this: [CODE]public IntSet(IntSet source) { //copy source field value to this object this.Data = source.Data; // assumes that IntSet has a Data property }[/CODE]Which is used like this … | |
Re: I think that Encryption streams are uni-directional meaning that you can not read back what you put in. A bit like the water in a stream being purified as it passes over the rocks; if you do not capture the water, it flows in to the sea and you have … | |
Re: Firstly, the code is VB and this is the C# forum. However, there are a couple of points that I can see where improvements can be made. (Apart from changing to C#:D) Ways to improve performance 1) Minimise the times you scan your data. Currently you call your [I]GetWords[/I] method … | |
Re: [QUOTE=MSDN]Gets or sets the HTML contents of the page displayed in the WebBrowser control.[/QUOTE] [URL="http://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser.documenttext.aspx"]MSDN WebBrowser.DocumentText Property[/URL] Try using something like this. [CODE]string pageContents = webBrowser1.DocumentText;[/CODE] | |
Re: From what I can see the code is correct and the task bar is showing the wrong time format. I tried using HH:ss as the time format and the task bar only showed the hours.:confused: It seems the task bar always suppresses the seconds; probably to reduce number of updates … | |
Re: Is this for a windows app or a web app? Is the user to select the buttons or is this in Dev. Studio? | |
Re: Since stream A is a MemoryStream you know its size. Add this as an integer to stream B before adding stream A. Now you know the size of the stream when de-serializing it. Alternatively, add stream A at the end of stream B. What is left after reading all the … | |
Re: What you use for persistence (storage) of your data and what you use in your code do not have to be the same. Using enumerated types is probably better and will make the code more readable. I.E. instead of [iCODE]case "1":[/iCODE] you could have [iCODE]case ArmAction.ArmUp:[/iCODE] which is easier to … | |
Re: Assuming that it is the Dark Blue that you do not want then it is because you are not resetting the [I]SelectionLength[/I] property to zero when you reset the [I]SelectionStart[/I]. [I]SelectionLength[/I] is still set to the length of the newly Red text and therefore the selection highlight is shown on … | |
Re: I use adatapost's method a lot. The key is the [I]ToString [/I]override. This is what determines what shows up in the listbox. I also tend to use the [B]as[/B] operator when retrieving the data instead of casting because this does not fail if no selection has been made yet (it … | |
Re: You can use the sort method to programmatically sort the DGV to a specific column. [CODE]DataGridView1.Sort(DataGridView1.Columns[0], ListSortDirection.Ascending);[/CODE] | |
I use the 'since last visit' button to find new/unread posts and I would like to mark the threads I have no interest in as read. The only way to do this now is to open the thread or, after viewing the threads i like, go to the formum and … | |
Re: This is an excellent way to protect a temporary file of data that might be passed between processes while the user is logged on. However, the [I][B]ProtectedMemory [/B][/I]encryption is only valid during the [B]current user session[/B] and therefore the saved data is [B]not retrievable if the user logs off[/B] and … | |
Re: Use MS Word or Windows Wordpad to create a Rich Text File with the formatting that you need. Open the file in Notepad to see how the formatting is achieved. Copy the text to the RichTextBox.Text property. Alternatively, use the RichTextBox methods [B]Find[/B], and [B]Select[/B], to highlight the work and … | |
Re: Dotfuscate puts the converted program in a different folder. Are you sure you are looking at the obfuscated executable? | |
Re: Changing the value of a control in code still triggers the controls change event (e.g. TextChanged for a TextBox). Is it due to one of these events that you are getting the error? Also, my preference is to use the [B]is [/B]operator to test for object types. It reads better … | |
Re: There are two ways to manage unwanted execution of event handlers. 1) Add a conditional statement in the event handler code to only execute when required. 2) Detach the event hander before the unwanted event triggers and re-attach after. | |
Re: Is the image in the forms Background property like Yamachi assumed? Is it the forms background showing through the image that gives the unwanted grey border? What do you get when you set the forms backcolor to Magenta (with TransparencyKey reset to default)? Does the grey border change to Magenta? … | |
Re: Be aware that making changes to the list you are enumerating WILL also cause values to be skipped as the list is updated and your enumerator is invalidated. Yamachi's solution will get around this problem as the enumerated list is not the one being modified. | |
Re: ASCIIEncoding might be what you need. Is the following the sort of thing you are doing? [CODE]byte[] bytes = new byte[] { 0x87, 0x31, 0x32, 0x33 }; string test = ASCIIEncoding.ASCII.GetString(bytes);[/CODE] | |
Re: Can you please clarify. You want to get the count of rows for a query, before doing the query, so you can accurately report the query progress? | |
Re: I am not sure that you can do what you want with the built in serializers. You may need to develop your own. How are you doing the serialization now? | |
Re: The following code, using your expression, reports [COLOR="Green"]Match=False[/COLOR] for [iCODE]test=string.Empty;[/iCODE]. [CODE]string rx = "^[1-9]+[0-9]*"; Regex reg = new Regex(rx); string test = string.Empty; MessageBox.Show(string.Format("IsMatch={0}", reg.IsMatch(test))); [/CODE] However, for [iCODE]test = null;[/iCODE] an error is generated, as the parameter to [I]IsMatch[/I] can not be null. Perhaps this is the problem you … | |
Hi all, I am about to upgrade my VS2005 system to VS2010. (My OS is Windows XP SP3) I would like to know if there is anything that I should do before upgrading that will make the process a little easier? Also, what problems will I have with my existing … | |
Re: Firstly, I would consider using the [I]DateTimePicker [/I]to get the time values as this provides better validation of times that the [I]MaskedTextBox[/I]. Secondly, if you are allowing the end time to be after midnight then there is no automatic validation that you can do to check if the entered time … | |
Re: Try passing the foreground form to the show method of the background form. [CODE]backgroundform obj=new backgroundform(); obj.show(this)[/CODE] This makes the background form a child of the foreground form and should now minimise with the foreground form. | |
Re: I tried your code and [I]theXML[/I] does contain data. However, all the values are stored as attributes and therefore there is no InnerText. Try changing [I]InnerText [/I]to [I]InnerXML[/I]. To find out how the returned data is formatted, place a breakpoint after the [I]GetData [/I]method and inspect [I]theXML.InnerXML[/I] using the [I]XMLVisualizer[/I]. | |
Re: [QUOTE=rico078]I have 2 windows forms (form_source and form_target) with listviews (lstviewSource and lstviewTarget) respectively. When the items from the "listviewSource" is selected it needs to be displayed on "lstviewTarget".I am cloning the items from the listview in "form_source" but it is not displaying on the listview on "form_target".[/QUOTE] You said … | |
Re: Your problem is because the Paint Event executes every time the form/control is painted on the screen. You should not be doing the loop in the Paint event. Tye using a Timer to increment a global integer to get the 'Temperature'. Then call Refresh or Invalidate to force a re-Paint. … | |
Re: If you have several flags that need to be reset you might considered using a BitArray. This has as SetAll method that will set all to flags to true or false. The only problem with this is having to keep track of which index corresponds to which flag. | |
Re: Best way to achieve this is to put all your controls in a panel of 200x150 set the [I]FormBorderStyle [/I]to [I]None [/I]and maximize the form. | |
Re: Below is a method that creates a form by using its type (provided that the form has a public default constructor). This should help you develop a more general method to show a form by passing the type of the form to open. [CODE]public Form CreateForm(Type formType) { Form form … | |
Re: Show some code of what you have tried so far, explain what/where the problem is and someone might help you. | |
Re: Although a property in C# is coded in a single block the compiler creates a get_<propname> function and set_<propname> method separately. To code a property in an interface you need to add the [I]get [/I]and [I]set [/I]keywords in braces. [CODE][Guid("1061ABA6-19E0-4ed2-A253-9C28D89771D7")] public interface IGC7890Controller { //Getters and setters int Column { … | |
Re: Using Ref double is correct. When you call the method, pass the first element of the array by ref. E.g. [iCODE]axCDFLAN.XferCommand(ref myFreqArray[0])[/iCODE] As this is a COM call you might need marshal your array using interop (System.Runtime.InteropServices Namespace). I have very little experience of interacting with COM objects so I'll … | |
Re: [U]A little about how the cells are edited using the DataGridView.[/U] When the user begins to edit a cell, a special edit control is automatically positioned over the cell, given the value of the cell and enabled. There is only one edit control for each column, suitable for the column … | |
Re: I found this that shows how to do it but its a bit complicated. [URL="http://msdn.microsoft.com/en-us/library/7tas5c80.aspx"]How to: Host Controls in Windows Forms DataGridView Cells[/URL] | |
Re: I think model_name should be uppercase i.e. !MODEL_NAME | |
Re: Your expression is OK. But you should be using [I]Matches [/I]not [I]Split[/I]. Try this [CODE] string pattern = @"(.{1,100}\b\s)"; Regex rex = new Regex(pattern); string[] Str; MatchCollection matches = rex.Matches(Detail); if (matches.Count > 0) { Str = new string[matches.Count]; for (int i = 0; i < Str.Length; i++) { Str[i] … | |
Re: I would recommend you have the image list already on your form and associated with the LV. Then just add the new image to the image list. As you have it coded now you can only have one image in the list. The next time an image is added the … | |
Re: As you are using [B]Form1[/B] for the base type of the [I]ComponentResourceManager[/I], it is looking for resource starting with [B]Form1.[/B]. Check that your resource files are named like this [B]Form1.en.resx[/B], [B]Form1.es.resx[/B], and [B]Form1.fr.resx[/B]. |
The End.