536 Posted Topics

Member Avatar for judithSampathwa

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?

Member Avatar for nick.crane
0
92
Member Avatar for Duki

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.

Member Avatar for Duki
0
2K
Member Avatar for judithSampathwa

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.

Member Avatar for Lusiphur
0
808
Member Avatar for judithSampathwa

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.

Member Avatar for gusano79
0
121
Member Avatar for Duki

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 } …

Member Avatar for nick.crane
0
112
Member Avatar for tuomari
Member Avatar for Mikey12345

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.

Member Avatar for nick.crane
0
59
Member Avatar for stephin

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?

Member Avatar for nick.crane
0
50
Member Avatar for rajdey1

Please show some code and explain where you are having trouble and I will try to help.

Member Avatar for nick.crane
0
206
Member Avatar for xuele91
Member Avatar for nick.crane
0
83
Member Avatar for nortech

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 …

Member Avatar for nortech
0
180
Member Avatar for virusisfound

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(); …

Member Avatar for nick.crane
0
109
Member Avatar for nick.crane

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 …

0
58
Member Avatar for Sarevok19

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 …

Member Avatar for nick.crane
0
513
Member Avatar for WargRider

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).

Member Avatar for WargRider
0
320
Member Avatar for khess

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]

Member Avatar for pogson
0
1K
Member Avatar for octavia

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 …

Member Avatar for octavia
0
1K
Member Avatar for bushman_IL

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 …

Member Avatar for bushman_IL
0
1K
Member Avatar for iDea22

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]

Member Avatar for nick.crane
0
159
Member Avatar for Dimansu

In what event is the code you posted? How is isValid used? Did you consider blocking all but number keys using the KeyDown event?

Member Avatar for ddanbe
0
84
Member Avatar for moshe12007

Add a DataTableView to your form. Then load your dataset as the DataSource. E.G. [CODE]dataTableView1.DataSource = ds; dataTableView1.DataMember = "Table1";[/CODE]

Member Avatar for nick.crane
0
99
Member Avatar for smita mone
Member Avatar for nick.crane
0
88
Member Avatar for judithSampathwa

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]

Member Avatar for nick.crane
0
166
Member Avatar for litlemaster

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]

Member Avatar for farooqaaa
0
88
Member Avatar for Laurender

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]

Member Avatar for nick.crane
0
68
Member Avatar for madhan
Member Avatar for madhan
0
108
Member Avatar for DaveTran

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 …

Member Avatar for nick.crane
1
202
Member Avatar for pupilstuff
Member Avatar for judithSampathwa

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".

Member Avatar for Ketsuekiame
0
171
Member Avatar for USSDeveloper

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 …

Member Avatar for Ketsuekiame
0
122
Member Avatar for max1million

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 …

Member Avatar for nick.crane
0
100
Member Avatar for thuyson

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)

Member Avatar for andrewll2
0
271
Member Avatar for neithan

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 < …

Member Avatar for neithan
0
128
Member Avatar for Roulaa
Member Avatar for Roulaa
0
174
Member Avatar for neithan

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 …

Member Avatar for nick.crane
0
151
Member Avatar for judithSampathwa

Use System.IO.Path.GetFileNameWithoutExtension [CODE]string fullfilename = @"C:\filename.txt"; string filenameonly = System.IO.Path.GetFileNameWithoutExtension(fullfilename); // filenameonly is now "filename"[/CODE]

Member Avatar for nick.crane
0
2K
Member Avatar for neo.mn

You can change the size of the header font in a DataGridView by modifying the font property of the ColumnHeaderDefaultCellStyle.

Member Avatar for neo.mn
0
97
Member Avatar for thuyson

If you have a specific problem with your code then please show where you are having trouble.

Member Avatar for nick.crane
0
37
Member Avatar for sdhawan

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.

Member Avatar for nick.crane
0
46
Member Avatar for weavercs
Member Avatar for charqus

Have you tried putting [iCODE]Welcome.Play();[/iCODE] in the Form_Shown event instead? This runs after the constructor and Form_Load.

Member Avatar for nick.crane
0
161
Member Avatar for SciFiCoder
Member Avatar for nick.crane
0
131
Member Avatar for judithSampathwa

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.

Member Avatar for kvprajapati
-1
132
Member Avatar for Medalgod

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.

Member Avatar for Medalgod
0
361
Member Avatar for neithan

[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.

Member Avatar for apegram
0
92
Member Avatar for bbman

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 …

Member Avatar for bbman
0
405
Member Avatar for muriloazevedo
Member Avatar for judithSampathwa

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 …

Member Avatar for nick.crane
0
107
Member Avatar for Mikey12345

To get the values from cells in a datagridview you can reference each cell with co-ordinates using [iCODE]dataGridView1[col, row].Value;[/iCODE]

Member Avatar for nick.crane
0
94
Member Avatar for Mikey12345

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.

Member Avatar for sknake
0
121

The End.