536 Posted Topics
Re: You are using string.Format incorrectly. [CODE]string.Format("Format text only and no value returns null")[/CODE]. You don't need the string.Format. Also, y o y do U use y ! why? | |
Re: In addition to Teme64's quick response (faster than I was anyway:D) you can manage the space around the controls by adjusting the forms Padding property or each control's Margin property. | |
Re: Are you still struggling with MaskedTextBox. The thing is totaly not fit for purpose. The mask is too restrictive and the user experience is not intuitive when using complex masks. Why don't you give-up and use the strategy offered to you by [POST=1251316]Radical Edward[/POST] a few day ago. | |
Re: Since the purpose of the CellValidating event is to confirm that the text entered by a user is in the valid format, your first test (after != null) should perhaps be to use [iCODE]DateTime.TryParse[/iCODE] to test if the entered value is in fact a date. | |
Re: When a class is marked partial (as forms are) you can have as many source files as you like for an object. Just copy the same patern as the Form.designer.cs file. E.G. Form1SQLCodeFile.cs [CODE] namespace WindowsApplication1 { partial class Form1 { // any code here is part of WindowsApplication1.Form1 } … | |
Re: Where do you see this "verbatim sign"? | |
Re: It is not possible to have unique font styles on a per item basis with the ListBox. If you need that kind of control then use a ListView instead. It is a little harder to use, but give greater flexibility on how each item is displayed. | |
Re: All [B]events[/B] are multicast delicates. Every time you set up a Button_Click event you are using a multicast deligate. Do you have any specific questions about multicast deligates? | |
Re: Please show some code and explain where you are having trouble and I will try to help. | |
Re: Show the code where you are getting this error and I will try to help. | |
Re: Your problem comes from your re-assigning masterTable to a new DataTable instance. Your binding source is assigned to the previous instance of masterTable and so does not update. Try this: Before doing the select rows, use [iCODE]SuspendBinding[/iCODE] on the binding source. Then clear masterTable and [iCODE]Merge[/iCODE] the new SelectRows DataTable … | |
Re: ereruh's post would mean the application closes when Form4 closes. If the login dialog is only required at the start of the application then one solution is to open the login form before the Application.Run in program.cs as below. [CODE]DialogResult result; using(Form4 loginDialog = new Form4()) { result = loginDialog.ShowDialog(); … | |
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: Hi Sarevok19, Wow, you have set yourself quite a project for a first time with multithreading. I think there is nothing wrong with using BackgroundWorker for what you are doing. There are many pitfalls when using multiple threads and the BackgroundWorker protects you from some of them. Also, it comes … | |
Re: I think you need VK_OEM_5 (or maybe VK_OEM_102). These are found towards the bottom of this MSDN library page: [URL="http://msdn.microsoft.com/en-us/library/bb431750.aspx"]Keys and Keycodes for Windows Mobile[/URL] Or you could try sending the ASCII code for | which is 124(0x7C). | |
Re: If its a wearable device you want check this out [URL="http://www.eurotech-ltd.co.uk/en/products.aspx?pg=Zypad%20WL%2011xx&pp=Wrist%20Worn%20Computers&pc=758&pid=10223"]http://www.eurotech-ltd.co.uk/en/products.aspx?pg=Zypad%20WL%2011xx&pp=Wrist%20Worn%20Computers&pc=758&pid=10223[/URL] | |
Re: Firstly, you should attach the event handlers in form load, otherwise, first MouseDown/MouseUp events not captured (event attached after execution). Second your code uses [iCODE](e.X)[/iCODE] in MouseUp event and [iCODE]progressBar1.Value[/iCODE] in MouseDown event. I think both should be the same. Regarding media player tracking: What other problems do you have … | |
Re: Converting your object to bytes or using the memorystream and binaryformatter seem the same to me. Consider this. If I was to take down my house brick by brick and then give you the bricks you would need plans on how to put it back together. The same is true … | |
Re: You probably need to use some pinvoke stuff. Here are some likely candidates from PInvoke.Net [URL="http://www.pinvoke.net/default.aspx/user32.EnumDesktopWindows"]EnumDesktopWindows[/URL] [URL="http://www.pinvoke.net/default.aspx/user32.GetWindow"]GetWindow[/URL] [URL="http://www.pinvoke.net/default.aspx/user32.GetWindowRect"]GetWindowRect[/URL] [URL="http://www.pinvoke.net/default.aspx/user32.getclientrect"]GetClientRect[/URL] Also this link has a code sample (in VB) to capture the image of any window, provided you have a window handle. [URL="http://www.pinvoke.net/default.aspx/user32.GetDesktopWindow"]GetDesktopWindow[/URL] | |
Re: In what event is the code you posted? How is isValid used? Did you consider blocking all but number keys using the KeyDown event? | |
Re: Add a DataTableView to your form. Then load your dataset as the DataSource. E.G. [CODE]dataTableView1.DataSource = ds; dataTableView1.DataMember = "Table1";[/CODE] | |
Re: Take a look at the System.Runtime.Remoting.Channels namespace. | |
Re: This statement [iCODE]BitConverter.GetBytes(bool.Parse(a));[/iCODE] is parsing the complete file (held in a) to a single bool and then converting the bool to a byte array! Is this what you intended? If not what did you expect to happen? Perhaps what you need is [CODE]bytearr = (byte[])reader.GetValue(0);[/CODE] | |
Re: These two threads (taken from Similar Threads to the right of your post) should help a bit. [URL="http://www.daniweb.com/forums/thread173131.html"]delegates and references to objects[/URL] [URL="http://www.daniweb.com/forums/thread34884.html"]delegates[/URL] | |
Re: Use nested for loops instead of foreach. [CODE]MyData[,] dataArray = new MyData[3, 5]; for (int x = 0; x < dataArray.GetLength(0); x++) { for (int y = 0; y < dataArray.GetLength(1); y++) { MyData dataItem = dataArray[x, y]; // do something with dataItem } }[/CODE] | |
Re: adatapost's post is only half the answer. You will also need to test the Settings type to be able to create the correct the bar class. [CODE]List<Settings> settingsList = new List<Settings>(); foo newBar; // local holding variable for (int i = 0; i < settingsList.Count; ++i) { // Spawn correct … | |
Re: These two links should help you understand what you can put in the ToString method and how this effects the resulting string. [URL="http://msdn.microsoft.com/en-us/library/dwhawy9k(VS.80).aspx"]Standard Numeric Format Strings[/URL] [URL="http://msdn.microsoft.com/en-us/library/0c899ak8(VS.80).aspx"]Custom Numeric Format Strings[/URL] Of particular note for you is probably the standard format code "C". | |
Re: You could sepearte out the data management classes to a seperate dll project. This will enable access to the data manipulation functions for all processes. If you need to reference objects from the MainMenu process then that is a totally differenct ball game and will also require cross process channels … | |
Re: For generic types you can test the IsGenericType property. Then you need to use [iCODE]GetGenericArguments()[/iCODE] to get an array of the types passed as arguments. Just curious, but what are you doing that needs such analysis of types? It is unusual to need to do such low level type reflection … | |
Re: You have the parentheses arount the wrong part in the casting. if ((bool)[COLOR="Red"]([/COLOR]dataGridView1.Rows[i].Cells["Chon"][COLOR="Red"])[/COLOR].Value == true) Try this if ((bool)[COLOR="Red"]([/COLOR]dataGridView1.Rows[i].Cells["Chon"].Value[COLOR="Red"])[/COLOR] == true) | |
Re: Why not use a panel instead and draw the cells in the panels paint event. Sample code to draw a block of dots in panel1. [CODE] private void panel1_Paint(object sender, PaintEventArgs e) { for (int i = 0; i < 100; i+=10) { for (int j = 0; j < … | |
Re: [QUOTE]does not actually close[/QUOTE] What do you mean by this? | |
Re: Event handler methods need to be attached to the events. The form designer hides the attachment from you by putting them in the [iCODE]InitializeComponent()[/iCODE] method which is found in the form1.designer.cs file. To attach an event handler using the designer: [INDENT]Select the control with the event. Click on the Event … | |
Re: Use System.IO.Path.GetFileNameWithoutExtension [CODE]string fullfilename = @"C:\filename.txt"; string filenameonly = System.IO.Path.GetFileNameWithoutExtension(fullfilename); // filenameonly is now "filename"[/CODE] | |
Re: You can change the size of the header font in a DataGridView by modifying the font property of the ColumnHeaderDefaultCellStyle. | |
Re: If you have a specific problem with your code then please show where you are having trouble. | |
Re: Look at the last posts in this thread [URL="http://www.daniweb.com/code/snippet290540.html"]SQL Databases using C# - Connecting and Updating[/URL] to find out how to use a parameterised query. This should help with your problem. | |
Re: Please show the code where you do the invoke. | |
Re: Have you tried putting [iCODE]Welcome.Play();[/iCODE] in the Form_Shown event instead? This runs after the constructor and Form_Load. | |
Re: You need to close your streams to flush the stream buffers before the app closes. | |
Re: You have already asked this question before!!! [URL="http://www.daniweb.com/forums/thread289099.html"]http://www.daniweb.com/forums/thread289099.html[/URL] [URL="http://www.daniweb.com/forums/thread283882.html"]http://www.daniweb.com/forums/thread283882.html[/URL] You should have enough answers there to solve the problem yourself. | |
Re: When the LoginDetails constructor executes ServerIP etc have defualt valeus. Put the code that copies the values to the textboxes in the form's shown event. That way it happens when the dialog is displayed not created. | |
Re: [iCODE]randNum.Next(0, 10);[/iCODE] returns an integer between 0 and 10 inclusive. You will only get one of 11 possibilites. Maybe you should think about increasing the range or using the NextDouble method instead. | |
Re: I have not used this API either. However in your callback you are trying to change the forms Text property. The callback is probably executing on a sepearte thread to the UI and thus causing a problem. As this is just a test program try using Debug.Write or Console write … | |
Re: What did you bind the Conrols.Visible property to? | |
Re: An event method is just another method. Call it as you would any other method. If you don't use the parameters in your code then you can use null place holder. E.G [iCODE]cbPW_TextChanged(null, null);[/iCODE] If you use the sender or event arg parameters then you must supply appropriate objects so … | |
Re: To get the values from cells in a datagridview you can reference each cell with co-ordinates using [iCODE]dataGridView1[col, row].Value;[/iCODE] | |
Re: This is normal and expected behaviour of a combo-box. It is not a problem for most users. As long as the combo-box has focus the scroll wheel will change the entry. Clicking in the text part or tabbing to a combo-box also cause this behaviour even without showing the list. |
The End.