536 Posted Topics

Member Avatar for MARKAND911

You are canceling the row validation for all rows, including valid ones. [CODE]private void grdvEnergy_RowValidating(object sender, DataGridViewCellCancelEventArgs e) { e.Cancel = true; //<-- this should only be done if an error exists. datagridview1.Rows[e.RowIndex].ErrorText = "Error message"; }[/CODE] You need to add a conditional statement to allow valid rows to commit. …

Member Avatar for nick.crane
0
2K
Member Avatar for sadhawan

An XML file can be created and edited using an [I]XmlDocument[/I] object and other classes from the [I]System.Xml[/I] namespace. However, there are other ways to create XML documents (e.g. from a DataTable or DataSet). It depends very much on what you mean by "plain text". As spdesings pointed out you …

Member Avatar for nick.crane
0
125
Member Avatar for Yanshof

You are only storing a pointer (IntPtr) to the bitmap. Are you sure that the bitmap still exists and is where it was when it was enqueued? I.e. Is the pointer still valid?

Member Avatar for nick.crane
0
139
Member Avatar for logitech1

There is no defined structure for a .dat file. It is often used by application to indicate data of some kind. If you know the application that created the files then maybe you can find out the structure of the .dat file. Otherwise you are stuck with having to inspect …

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

If by [I]selected[/I] you mean [I]Checked[/I] then just set them all unchecked (i.e. [iCODE]rb.Checked = false;[/iCODE]). [Edit] Also, make sure the they are not set by the form designer. Set them all false there too.

Member Avatar for judithSampathwa
0
1K
Member Avatar for trippinz

Did you really need to post all those [iCODE]Control.Font Font = new Font(ff, 9, fontStyle);[/iCODE] lines in your code sample? It made the post unnecessarily big.:@ Not sure if this will fix your problem because it still uses the [I]PrivateFontCollection[/I]. However, the only time I had to use a font …

Member Avatar for trippinz
1
279
Member Avatar for markthien

I ran in to the same problem some time ago. One easy way is to put the files in a folder off the root. (e.g. "C:\MyData"). The more elegant but much more difficult solution is to have a custom action in the installer to modify the security of the path. …

Member Avatar for gusano79
0
452
Member Avatar for markthien

The code you copied uses a set of global (local to form) variables to store the page infomation for the DGV. [CODE] private string NavClicked = ""; private string RecordID1 = ""; private string RecordID2 = ""; int CurrentPage = 1; [/CODE] I think that this might be the root …

Member Avatar for nick.crane
0
170
Member Avatar for juhi1

Do you have two tab controls or two tabs on a single tab control? Is there one or two forms? Not sure what you mean by [QUOTE]I have class already made for the first tab.[/QUOTE] Any code needed to manage the controls should be on the form. I will assume …

Member Avatar for arunkumars
0
264
Member Avatar for calnastic

You forgot to add the place holder for the value. [CODE]Console.WriteLine("first dimension length {0}", arr.Length);[/CODE]

Member Avatar for calnastic
0
101
Member Avatar for muriloazevedo

Without some code we can not know what is happening. What do you do when a value is selected?

Member Avatar for muriloazevedo
0
175
Member Avatar for drake10k

If the second form is open using ShowDialog (which it probably should) then you can add a property on the second form to hold the new listbox value. Then when the form is closed retrieve the value from the property and update the list box on the first form. Add …

Member Avatar for drake10k
0
787
Member Avatar for swetz

Your function is declared [I]static[/I]. Is [I]NulltoString [/I]also static?

Member Avatar for nick.crane
0
179
Member Avatar for imso

Slightly adapted version allows "nudging" of any control. [CODE] public void NudgeControl(Control ctrl) { // Store the original location of the form. int xCoord = ctrl.Left; int yCoord = ctrl.Top; // An integer for storing the random number each time int rnd = 0; // Instantiate the random generation mechanism …

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

Firstly, please look at the properties that are available on the [I]OpenFileDialog[/I]. There are some there that will answer your first question. When the dialog closes with [I]DialogResult.OK[/I] then you get the selected file from the [I]FileName[/I] property. To run the associated program, just execute the file in a new …

Member Avatar for judithSampathwa
0
151
Member Avatar for NH1

Do you mean label?:confused: To do this with a [I]TextBox[/I], in the [I]TextChanged [/I]event handler, parse the [I]Text [/I]property for the short-cuts you want to support and replace as necessary.

Member Avatar for NH1
0
80
Member Avatar for AngelicOne

I just tried to run the command in MS SQL Server Management Studio Express (2005). [I]create table tbl (orderdate date)[/I] It does not execute giving the Error: [COLOR="Red"]Msg 2715, Level 16, State 7, Line 1 Column, parameter, or variable #1: Cannot find data type date.[/COLOR] Also, when I use the …

Member Avatar for nick.crane
0
118
Member Avatar for valter

I found these two links to be most useful when learning about Regex. [URL="http://www.codeproject.com/KB/dotnet/regextutorial.aspx"]The 30 Minute Regex Tutorial[/URL] [URL="http://msdn.microsoft.com/en-us/library/az24scfc.aspx"]Regular Expression Language Elements[/URL] Also this one has some samples for various things. [URL="http://regexlib.com/Default.aspx"]Regexlib.com[/URL]

Member Avatar for PierlucSS
0
74
Member Avatar for imso

I think you may want [iCODE]txtReminder.Select();[/iCODE] [Edit]@Ryshad: [QUOTE=MSDN Control.Focus]The Focus method returns true if the control successfully received input focus. The control can have the input focus while not displaying any visual cues of having the focus. This behavior is primarily observed by the nonselectable controls listed below, or any …

Member Avatar for nick.crane
0
138
Member Avatar for Suzie999

You might want to consider using the application [I]Settings[/I]. (Properties Settings Tab) There are two types of settings, Application and User. User settings are specific to the current user and it is possible to read/write User settings. These are generally used to save user configurable options. Application settings are read …

Member Avatar for nick.crane
0
106
Member Avatar for Smithy566

The default base is 10. Try this [CODE]myNewByte = System.Convert.ToByte(hexString, 16); [/CODE]

Member Avatar for Smithy566
0
96
Member Avatar for buster2209
Member Avatar for Steve_Jones

[QUOTE]I need to learn visual studio, sql, asp.net, and building and maintaining databases, how can i best do this?[/QUOTE] If that is what you want to do then why not set your self a problem? Create a DB to store some information of interest to you. (E.g. Document your collection …

Member Avatar for taylby
0
124
Member Avatar for SlickSteiner

Try using += operator. [CODE]tpricehw+=MB+Monitor+Proc+CC+KB+M+VC+ODD+totalpram+totalphdd;[/CODE] BTW. This is the C# forum.

Member Avatar for nick.crane
0
114
Member Avatar for hirenpatel53

I have tried doing similar things with the [I]CheckedListBox [/I]before. The information on the checked items is not yet updated when the [I]ItemCheck[/I] event fires. This just makes all the logic very difficult. I gave up trying doing my logic in the [I]ItemCheck[/I] event. The solution I came up with …

Member Avatar for nick.crane
0
464
Member Avatar for Merlin33069

One way to handle this is to read all the received data in to a byte array. Then parse the byte array to exctract what you need. Another is to parse the stream as you read it byte by byte (or block by block). However, this can lead to the …

Member Avatar for Merlin33069
0
104
Member Avatar for calquan
Member Avatar for eligio

If you want to draw an image cliped to a triangle then you need to use a [I]GraphicsPath [/I]to set a clip [I]Region[/I]. The following code clips the [I]Bitmap1.bmp[/I] image when drawn at the top left of the form. [CODE] private void Form1_Paint(object sender, PaintEventArgs e) { // create a …

Member Avatar for eligio
0
1K
Member Avatar for sadhawan

You will need to read the file in to a byte array; try using [iCODE]System.IO.File.ReadAllBytes(filename);[/iCODE] Then pass this as a parameter to a varbinary(MAX) column in you DB. Don't forget to store the filename and extension; if you store them seperately you will later be able to sort/filter on file …

Member Avatar for sadhawan
0
59
Member Avatar for DaveTELFA
Member Avatar for garyl671

I just set up an unbound DataGridVeiw with three columns as you describe. The CheckBoxes are checked/unchecked by the user with out any problem. Are you sure you have allowed user edits. Check the ReadOnly status of the columns.:?: Note: When you uncheck the "Enable Editing" on the DataGridView Task …

Member Avatar for nick.crane
0
586
Member Avatar for nssltd

You've missed out [I]InitializeComponent[/I] from the form constructor.

Member Avatar for nssltd
1
364
Member Avatar for mxadam

Does [I]BitBlt[/I] return 0? Can you not use [iCODE]gdest.CopyFromScreen(location, new Point(), new Size(1, 1));[/iCODE] to get the screen color? How much of a difference is the color returned by [I]GetColorAt[/I] and the test color. Maybe you would be better off passing in the color and using [I]gsrc.GetNearestColor(color)[/I] to ensure your …

Member Avatar for nick.crane
0
211
Member Avatar for empyrean

I found [URL="http://www.codekeep.net/snippets/34d04a2b-7876-441a-b0ea-c5960dde2b7d.aspx"]this link[/URL] that shows one way to do it. I adapted it slightly to make it a bit clearer. [CODE] private void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e) { // get style to use for row header cells DataGridViewCellStyle style = dataGridView1.RowHeadersDefaultCellStyle; // get pen (needed to get text brush) …

Member Avatar for ddanbe
0
2K
Member Avatar for judithSampathwa

What a very clumsy way to do padding. There are methods to add padding to a string. Take a look at this. [CODE] string amt = " 123.56 "; string value = string.Empty; decimal dec; if (decimal.TryParse(amt.Trim(), out dec)) { value = (dec * 100).ToString("F0"); value = value.PadLeft(16); //<-- not …

Member Avatar for Geekitygeek
0
294
Member Avatar for judithSampathwa

Take a look at the "Similar Threads" to the right of your post. This should get you started.

Member Avatar for nick.crane
0
95
Member Avatar for DaveTran

I'd let the compiler manage the indexing for you by declaring the array as 2D. [CODE]string[,] array = new string[,] { { "0", "1" }, { "2", "3" }, { "4", "5" } };[/CODE]Then your code will be very similar to the 1D version, just add the extra index for …

Member Avatar for nick.crane
1
3K
Member Avatar for Zinderin

On deserialize (assuming no errors occur) each record must be read in turn. The stream pointer should be pointing to the start of the next record after reading the first. Just add each record to your list in turn and read the next. I would recommend that you first serialize …

Member Avatar for nick.crane
0
170
Member Avatar for GAME

You are changing the list as you iterate through it. This always causes problems. Try reversing the search order. [CODE]for (int i = tree.Items.Count - 1; i > 0; i--) { if (tree.Items[i].ToString().Contains(" ")) { tree.Items.RemoveAt(i); } } [/CODE] [B]Note[/B]: If the list is DataBound then you must modify the …

Member Avatar for Geekitygeek
0
137
Member Avatar for Nexgr

You can not use relative paths in the WebBrowser. But you can find the path of the executable by using Application.ExecutablePath. [CODE]string folder = System.IO.Path.GetDirectoryName(Application.ExecutablePath); string url = System.IO.Path.Combine(folder, "xy.htm");[/CODE]

Member Avatar for Nexgr
0
2K
Member Avatar for Dudeman3000

[QUOTE]If all parameter passing is by value by default, why does the ProcessList() function not have a local copy of myList ? (does it?)[/QUOTE] Objects and other reference types (this includes lists) are passed by reference by default. Or rather, the object reference is passed by value (which is sort …

Member Avatar for nick.crane
0
156
Member Avatar for Alexpap

I think the problem is that you are moving the child node. [CODE]public void DoTreeWork(RadTreeNode node) { RadTreeNode n = node; RadTreeNode temp = new RadTreeNode(node.Text); temp.Name = node.Name; foreach(RadTreeNode child in n.Nodes) ----------> The Exception is thrown. { temp.Nodes.Add(child); //<-- Moving child! Should do copy DoTreeWork(child); } tv2.Nodes.Add(temp); }[/CODE]

Member Avatar for nick.crane
0
245
Member Avatar for solid2005

The image of another ImageBox is not used when determining what to paint for transparent images. As Ryshad pointed out it is the background of the parent control that is used. Rather than put the background image in a picturebox, either [LIST] [*]Set the forms background to your background image. …

Member Avatar for Geekitygeek
0
122
Member Avatar for terence193

A mechanical engineer, an electrical engineer and a software engineer are in a car when it malfunctions and they speed uncontrolably down a hill, finally coming to a stop on a grass verge. The mechanical engineer says "Lets check if the brakes are faulty". The electrical engneer says "Lets check …

Member Avatar for vegaseat
0
888
Member Avatar for MoriEdan

[COLOR="Red"]//I HAVE TO DO SMTH HERE (IN MY OPINION)[/COLOR] What about doing this: [CODE]Form form = obj as Form; if (form != null) { form.MdiParent = this; form.Show(); }[/CODE]

Member Avatar for MoriEdan
0
605
Member Avatar for drspock

I have never used this before but when I tried it the tooltip always showed up in the same place. This place is however determined by the current mouse position meaning that it could be anywhere. The help tooltip window is shown with its top centered where the mouse is …

Member Avatar for drspock
0
173
Member Avatar for sadhawan

Look in the [I]System.IO[/I] namespace. Especially [I]System.IO.File[/I] and [I]System.IO.Directory[/I]. These are used to inspect the file system.

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

Use the [I][B]CellBeginEdit [/B][/I]event. Not used it myself but it is a [B]cancel[/B]able event so I think setting [I]e.Cancel [/I]will block the edit from starting. As with other events for the DGV, test [I]e.ColumnIndex[/I] and [I]e.RowIndex[/I] to only allow editing of the cells you want.

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

If the effect you want is to have all but one controls disabled while the second form is open then disable them just before you open the second form. One way is to disable all the controls using the [iCODE]foreach(Control c in oForm.Controls)[/iCODE] idea show by Teme64. Then enable the …

Member Avatar for judithSampathwa
0
201
Member Avatar for judithSampathwa

Why not take a look at [URL="http://www.daniweb.com/forums/thread297772.html"]this thread[/URL].;) What have you tried already?

Member Avatar for judithSampathwa
1
104

The End.