536 Posted Topics

Member Avatar for zachattack05

I know that this is solved but another alternative is to create your own derived control and add any additional properties, methods or delegates you need. [CODE] public class MyDataClass { // define class here } public class MyRadioButton : RadioButton { public MyDataClass DataItem { get; set; } }[/CODE] …

Member Avatar for zachattack05
0
215
Member Avatar for Kezuino

Of course the main form is created again. That is exactly what you are doing on line 2. You need to pass a reference to your main form to the search form. Try looking at [URL="http://www.daniweb.com/software-development/csharp/threads/268624/1165935#post1165935"]this post[/URL]. Which is also found in the [B]Similar Threads[/B] for this thread!

Member Avatar for Momerath
0
184
Member Avatar for kapojian
Member Avatar for kapojian
0
140
Member Avatar for Roobin

You can get the same output using a bit-mask. [CODE]Console.WriteLine("Using bitmask"); for (int i = 0; i < read.Length; i++) { int bitMask = 0x8000; // start from left most bit Console.Write(string.Format("Register {0}: ", i)); for (int j = 0; j < 16; j++) { // test bit status and …

Member Avatar for sknake
0
855
Member Avatar for bLuEmEzzy

Your code in line 3 only allows numbers. You need to change this to allow the '.' too.

Member Avatar for bLuEmEzzy
0
180
Member Avatar for zachattack05

To control the way the items are displayed in a listbox you need to set [I]DrawMode[/I] to either [I]OwnerDrawFixed[/I] or [I]OwnerDrawVariable[/I]. [URL="http://msdn.microsoft.com/en-us/library/system.windows.forms.listbox.drawmode.aspx"]MSDN - Listbox.DrawMode[/URL] Not sure how/if this will work with a databound listbox (it should do).

Member Avatar for zachattack05
0
91
Member Avatar for Singlem

If the first form is an MDI master form (has [I]IsMDIContainer[/I] = true) and the second form is a child form (has [I]MdiParent[/I] = firstform) then the child form is held inside the borders of the main form. Setting the borders of the child form to be None ([I]FormBorderStyle = …

Member Avatar for nick.crane
0
129
Member Avatar for bhagawatshinde

Sounds like you might be doing the download in the UI thread. If this is the case then the whole UI is probably hung waiting for the download to finish. The easiest way to manage a big task in a windows forms app is to use a BackgroundWorker. The code …

Member Avatar for bhagawatshinde
0
547
Member Avatar for Bountyhuntr

You can get a list of the [I]PictureBoxes [/I]in the [I]Controls [/I]collection using the linq extension method [B]OfType[/B]. Then sort the list to get them in name order. [CODE]var myPics = this.Controls.OfType<PictureBox>().ToList(); myPics.Sort((a, b) => { return a.Name.CompareTo(b.Name); }); [/CODE] You should only need to do this once, in the …

Member Avatar for ddanbe
0
330
Member Avatar for djjavo

It should be possible to just copy the whole of the solution folder via a memory stick. If you need to keep the size down then use [I]Build - Clean Solution[/I] to remove the built files first.

Member Avatar for djjavo
0
223
Member Avatar for murali53

[QUOTE=murali53;1627329]When i double click on saved file icon my application is opening in my file format with my UI design,but not he data in it.[/QUOTE] Does this mean clicking on the file in file explorere? If so, then you need to make your application main method handle incoming parameters. Something …

Member Avatar for nick.crane
0
173
Member Avatar for destruct0
Member Avatar for skatamatic

I had to do something similar myself. I think that your table 2 idea is better. Better scalability, greater flexibility for searching. With the correct table indexing performance should not be an issue. For a whole lot of ideas on databases and SQL I generally go to [URL="http://www.sqlservercentral.com/"]http://www.sqlservercentral.com/[/URL] I find …

Member Avatar for rikthefrog
0
345
Member Avatar for tapandesai007

The Add..Seat methods are adding seats to the main form. You need to add the seats to the appropriate panel! E.g. at line 86 use [iCODE]this.PlatinumPanel.Contols.Add(seat);[/iCODE] Additionally, each of the three Add...seats methods has a lot of common code. Find where they differ, then using parameters make a common method. …

Member Avatar for nick.crane
0
349
Member Avatar for king03

Test the Count Momerath mentions in the ItemCheck event. There you can block the check by setting the e.NewValue to Unchecked.

Member Avatar for mshauny
0
133
Member Avatar for Shameema B

Capture the DataGridView CellClick or CellDoubleClick events. In the event handler test the DataGridViewCellEventArgs RowIndex property. Using this fill the text boxes with the correct row data.

Member Avatar for nick.crane
0
74
Member Avatar for king03

Not quite sure what you mean by ".. already selected... cannot select that item again". Two ideas that might help you achieve what you want. 1. Remove the item once selected - (perhaps moving it to another listbox). 2. Set SelectionMode to MultiSimple - that way once it is selected …

Member Avatar for mshauny
0
162
Member Avatar for tapandesai007

Your problem is in "SetOccupiedSeats". You are not changing any of the values in the seat list. Try this in place of your [iCODE]if (seatOccupied == 1) { ... }[/iCODE] code. [CODE]list.First(w => w.Number == seatNumbr).Occupied = seatOccupied == 1; [/CODE]

Member Avatar for nick.crane
0
359
Member Avatar for coroll

[QUOTE=nmaillet;1625750]I know when building VC++ in Visual Studio, it gives you the option to run the previous successful build, if there are compile errors.[/QUOTE] Yes, this caused me much confusion when I started with VS until I turned it off. It is found in Tools - Options - Projects and …

Member Avatar for nmaillet
0
118
Member Avatar for bhagawatshinde

You just need to use the appropriate SQL command. I use something like this: Backup - "USE MASTER; BACKUP DATABASE [<DBName>] TO DISK = N'<FileName>' WITH FORMAT, INIT, NAME = N'<Backup Name>', SKIP" Restore - "USE MASTER; RESTORE DATABASE [<DBName>] FROM DISK = N'<FileName>' WITH FILE = 1, REPLACE" Execute …

Member Avatar for nick.crane
0
147
Member Avatar for mrjimoy_05

[QUOTE=mrjimoy_05;1625614]I am using Microsoft Visual Studio 2010 Express for Windows Phone and .Net 4.0 Framework.[/QUOTE] [B]Windows Phone[/B] version is closer to [B]Silverlight [/B]and does not have support for the static [I]File.Read..[/I] methods. [URL="http://msdn.microsoft.com/en-us/library/system.io.file(v=VS.95).aspx"]See here.[/URL] You will have to use a [I]TextReader[/I], [I]StreamReader [/I]or [I]FileStream [/I]to execute the reads long hand …

Member Avatar for nick.crane
0
1K
Member Avatar for judithSampathwa

Judith, you asked a similar question in [URL="http://www.daniweb.com/software-development/csharp/threads/375715"]this thread[/URL]. What effect are you trying to achieve? [Edit] What do you mean by "attach one user control to each menu strip"?

Member Avatar for nick.crane
0
214
Member Avatar for uva1102

I am guessing now.:confused: Is the problem that the month is always 1 for the source data "2 Yearly 25"?:idea: If this is the case then perhaps you should add a DueMonth field to the original data table or allow DuePattern to have two fields e.g. "25/3". Then use the …

Member Avatar for nick.crane
0
134
Member Avatar for lianpiau

Have you looked at the Click-Once deployment. This does something like what you want in that it will look for the latest version before the program is executed and automatically download if it is newer.

Member Avatar for nick.crane
0
76
Member Avatar for markaroni

Your start button is correct. But each of the [I]stop [/I]buttons should only [I]stop [/I]one of the timers. You do not need to [I]start [/I]the timers in your [B]stop [/B]buttons!

Member Avatar for markaroni
0
460
Member Avatar for vishal1949
Member Avatar for nick.crane
1
130
Member Avatar for kapojian

Why do you need to convert [I]GlobalClass.globalweekdt[/I]? Have you checked what value the convertion returns. e.g. [iCODE]MessageBox.Show("globalweekdt = {0}",Convert.ToDateTim(GlobalClass.globalweekdt));[/iCODE] If[I] GlobalClass.globalweekdt[/I] is a string then it might be a localization issue due to different datetime formats.

Member Avatar for bhagawatshinde
0
784
Member Avatar for trungdang

What ways have you already tried? Is it necessary that it is an ArrayList?

Member Avatar for ddanbe
-1
804
Member Avatar for judithSampathwa

The following quick example should help. [CODE]public Form1() { InitializeComponent(); // create embedded form var form = new Form(); form.SetBounds(100, 100, 200, 300); form.BackColor = Color.PaleTurquoise; // set to highlight this form position form.TopLevel = false; // important otherwise cannot add to Control collection form.Visible = true; // important otherwise …

Member Avatar for nick.crane
0
272
Member Avatar for BCMusic24
Member Avatar for nick.crane
0
93
Member Avatar for westony

A foreach loop is just an easier way to access each item in a list or array. [CODE]foreach (DataRow dr in dtPeople.Rows) { //do something with dr }[/CODE] is similar to [CODE]for (int i = 0; i < dtPeople.Rows.Count; i++) { DataRow dr = dtPeople.Rows[i]; //do something with dr }[/CODE] …

Member Avatar for nick.crane
0
111
Member Avatar for abdelhakeem

You reached 186 points, so you achieved position 141438 of 570619 on the ranking list You type 259 characters per minute You have 44 correct words and you have 1 wrong words Not as fast as I thought.:-O But then I'm usually only typing code, which is not the same.

Member Avatar for nick.crane
0
453
Member Avatar for eoop.org

It is generally not possible to host one application in another; which I think you are trying to do. If you are trying to write a MDI text editor then you will have to do some of the work. You can add a TextBox or RichTextBox control to a child …

Member Avatar for Ketsuekiame
0
172
Member Avatar for sandeepparekh9
Member Avatar for maximocn
-1
284
Member Avatar for vincezed

In the [I]AfterCheck [/I]event the [I]TreeViewEventArgs [/I]contains the node that was just (un)checked. Try this instead. [CODE]private void treeView1_AfterCheck(object sender, TreeViewEventArgs e) { if (e.Node.Checked) { aResult.Add(e.Node); } else { if (aResult.Contains(e.Node)) { aResult.Remove(e.Node); } } } }[/CODE] BTW. To get your [I]CheckedNames[/I] to work you must use recursion to …

Member Avatar for nick.crane
0
181
Member Avatar for vuyiswamb

I had a similar problems when using [I]Image.FromStream[/I] with a [I]MemoryStream [/I]object. The local [I]MemoryStream [/I]object goes out of scope when you exit the function. As the image does not have a strong reference to the stream it is subject to Garbage Collection. This means the [I]MemoryStream [/I]is closed and …

Member Avatar for vuyiswamb
0
2K
Member Avatar for ahmedshayan

In the line [iCODE]double regFee = Convert.ToDouble(cmbFeeSchedule_Registration.SelectedText);[/iCODE] in SaleTax it is possible that '[I]SelectedText[/I]' does not yet have a value. This is possible because your code is running in the [I]SelectedIndexChanged [/I]event. If you want to use the [I]SelectedText [/I]then consider using the [I]TextChanged [/I]event instead. Perhaps more suitable would …

Member Avatar for abelLazm
0
165
Member Avatar for vincezed

Surely all you need to do is [iCODE]newParentNode.Tag = <some value>;[/iCODE] maybe [iCODE]newParentNode.Tag = dta;[/iCODE] Ignore this. See next post.

Member Avatar for vincezed
0
2K
Member Avatar for towerrounder

You should be able to use the FK constraint to retrieve the images for a specific message without needing to iterating through the whole image table. Use DataRow.GetChildRows to do this. Adding suitable indexes may also improve your performance.

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

Use the SelectedIndex property of the tab control to identify the current tab. Or use the SelectedTab property to directly access the current TabPage.

Member Avatar for umair.sabri
0
410
Member Avatar for krishnisilva

krishnisilva, The Validating event is fired when the user leaves a control. It is possible to prevent the user from leaving the control if the value is invalid by setting Cancel on the CancelEventArgs parameter to true. [CODE]private void dpStartD_Validating(object sender, CancelEventArgs e) { if (System.DateTime.Compare(dpStartD.Value, DateTime.Now) < 0) { …

Member Avatar for kheddy
0
2K
Member Avatar for jugosoft

Drawing to a control's Graphics object like this is only temporary. When the control is next refreshed the image will disappear. You need to create an image object and draw to that then assign this to the picture box. Try modifying your code as below. You should them be able …

Member Avatar for jugosoft
0
198
Member Avatar for elizabeth mwash

The SaveFileDialog does not save anything. It is used to get the filename and path of where the user wants you to save the data. You must test the return value from the ShowDialog method. If it is DialogResult.OK you then save the data to a file using the FileName …

Member Avatar for JOSheaIV
0
186
Member Avatar for TheDocterd

One of the built in column classes available for the DGV is the [I]DataGridViewCheckBoxColumn[/I]. This has a [I]TrueValue [/I] property and a [I]FalseValue[/I] property that determine the value of the data in the underlying DataTable (and database) for the checked and unchecked state of the checkbox shown in the column. …

Member Avatar for TheDocterd
0
2K
Member Avatar for Norzog

This code snippet should help you do what you want. [CODE]int x = Console.CursorLeft; int y = Console.CursorTop; ConsoleColor initColour = Console.ForegroundColor; Console.ForegroundColor = ConsoleColor.White; Console.WriteLine("This is white Text"); Console.ForegroundColor = initColour; Console.WriteLine("Press any key to continue..."); Console.ReadKey(); Console.SetCursorPosition(x,y); Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine("This is yellow Text"); Console.ForegroundColor = initColour; Console.WriteLine("Press …

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

The result from the IComparer.Compare is the result of the comparison, not the difference between the values tested. [CODE=text]Less than zero (usually -1) means x is less than y. Zero means x equals y. Greater than zero (usually +1) means x is greater than y.[/CODE] See [URL="http://msdn.microsoft.com/en-us/library/system.collections.icomparer.compare.aspx"]IComparer.Compare Method[/URL]

Member Avatar for DaveTran
0
2K
Member Avatar for CharlieHolt

It might be better to pass the row to the display form instead of the data values. That way any changes on the child form can be written directly to the relevant row. In the main form write a method to add a new row and spawn a new form. …

Member Avatar for Mitja Bonca
0
154
Member Avatar for fernandomier

Sounds like the CanonCamera object (or at least the SDK object it wraps) wants its methods executed on the thread in which it was created. You might need to invoke a method in your timer(s) to run camera operations. [CODE]private void Timer_foto_Tick(object sender, EventArgs e) { this.Invoke(TakeFoto); // forces execution …

Member Avatar for everhett.raman
0
425
Member Avatar for Sarafyna

[I]MdiChildActivate[/I] is an event called by the parent MDI when a child form is activated. The event handler should be on the main form not the child form. Try this. [CODE]private void MDIParent1_MdiChildActivate(object sender, EventArgs e) { string childName = "No Child Open"; if (this.ActiveMdiChild != null) { childName = …

Member Avatar for Sarafyna
0
146
Member Avatar for ashishkumar008

A very good question. I tried the code (in VS2005) and get the same results. It is because the compiler is using an Int32 for the result of the calculation. Constants are Int32 by default and the result is therefore being promoted to Int32. Try this instead. It gives the …

Member Avatar for nick.crane
3
142

The End.