Has anyone experienced lockup issues when adding animated gifs to a typical Windows Form? I have a simple form with a picureBox panel. When I add an animated gif, the environment locks up and I have to kill it through task manager. Is this a known bug or is there a workaround? Thanks in advance for any info. Ray
raysot777
Posts
-
C# and animated GIFs (VS.Net 2003) -
Determine if a thread has been instantiatedThat works! Thank you!!
-
Determine if a thread has been instantiatedI am trying to find a way to determine if a thread object has been instantiated. Not if it's been started/stopped/suspended, etc, but instantiated/declared: ie: t = new Thread(new ThreadStart(FSUIPC_Handler)); if(t exists) { t.Start(); } How could I determine if "t" exists?
-
Even more fun with @%&$@$%# Datagrids!I have one last line of code to write then this project is complete. I have spent 2 weeks on this "Last Line" .... :-) Trying to read the contents of a datagrid to Excel: This works if the column is simply a bound column: For i = 0 To StatusGrid.Items.Count - 1 worksheet.Cells(i + 2, 1) = StatusGrid.Items(i).Cells(1).Text() Next However, for Template columns, the following SHOULD work, but does not: For i = 0 To StatusGrid.Items.Count - 1 worksheet.Cells(i + 2, 2) = CType(StatusGrid.Items(i).Cells(2).Controls(0), DataBoundLiteralControl).Text() Next I get the following error: Unable to cast object of type 'System.Web.UI.LiteralControl' to type 'System.Web.UI.DataBoundLiteralControl'. I am at my wit's end on this one... Can anyone help?
-
Getting the value of a single cell in a datagridThat seems to be the problem: //-- This works well: (just a bound column) For i = 0 To StatusGrid.Items.Count - 1 worksheet.Cells(i + 2, 1) = StatusGrid.Items(i).Cells(1).Text() Next //-- but when I use: (Tries to get a Template Column) For i = 0 To StatusGrid.Items.Count - 1 worksheet.Cells(i + 2, 2) = StatusGrid.Items(i).FindControl("lblDateAdded").ToString() Next ...the appropriate cell text reads: "System.Web.UI.WebControls.Label" It doesn't seem to be finding the lblDateAdded control using the above method. Do I need to be casting it? -- modified at 18:55 Monday 3rd October, 2005
-
Getting the value of a single cell in a datagridSo far so good. That works on bound columns beautifully. Some of the other columns are rendered as Template columns. How would you perform the same operation on a column as defined here: Thanks again in advance for all of your help. -Ray
-
Getting the value of a single cell in a datagridThis is definitely Monday. I have an Excel worksheet that I am trying to get the contents of a DataGrid into. worksheet.Cells(2, 1) = StatusGrid.Column(1).Item(1) It would be nice if it were that simple. I was thiking of casting the datagrid into a table, but for reasons that are too cosmic to go into here, that is not possible at this time. So... the question is.. Using VB.Net (ASP), how in the world does one reference a Cell in a datagrid?
-
Embed a web link inside a messageBox()How does one go about making part of the messagebox() show a web link? something to the effect of: MesageBox.Show("Help File Not Found: \n\nTo download the latest Helpfile, go here:" + SomeSortaWeblink(http://www.mysite.com)) Any help is truly Appreciated -- modified at 0:30 Sunday 2nd October, 2005
-
Exporting a Datagrid to ExcelI had no idea it could be that simple. This is a project for work (I'm normally a DBA by trade) and I'll plug in first thing Monday morning and give this a whirl. You have been incredibly helpful, Dave and I really appreciate your expertise. (I was just about to give up on this whole Excel thing and tell my boss if he wants the info on the website, just copy/paste it... :-) I'll let you know Monday how it all works out. If I can get just one cell to reflect info off the ASP page, I'll consider this a success. Ray
-
Exporting a Datagrid to Excel...that seems to be where I am stuck at - inserting the values one at a time. Using the code: Dim args1(1) As Object args1(0) = nCell Range1.GetType().InvokeMember("Value", BindingFlags.SetProperty, Nothing, Range1, args1) ..I get an error that states: "Public member 'GetType' on type 'Range' not found." Since I'm using VS.Net 2005, I am wondering if there is a library I am missing or if the function has been removed altogether. That is where I am at. Inserting the data, even a single cell value is proving to be my ticket to insanity. So close, yet so far.
-
Exporting a Datagrid to ExcelHello, I am trying to export the contents of a datagrid to Excel. Here's the code I have so far: 'Fire up an Excel instance Dim ExcelApp As New Excel.Application ExcelApp.Visible = True Dim workbooks As Workbooks = ExcelApp.Workbooks Dim workbook As _Workbook = workbooks.Add(XlWBATemplate.xlWBATWorksheet) Dim sheets As Sheets = workbook.Worksheets Dim worksheet As _Worksheet = CType(sheets.Item(1), _Worksheet) 'Put some data on the Worksheet -- This doesn't work, but throws no errors Dim nCell As Integer = 5 Dim Range2 As Range = worksheet.Range("A1", "E1") Dim array2(nCell) As Integer Dim i As Integer For i = 0 To (array2.GetLength(0)) - 1 array2(i) = i + 1 Next Dim args2(1) As Object args2(0) = array2 Range2.GetType().InvokeMember("Value", BindingFlags.SetProperty, Nothing, Range2, args2) Everything works except the last line. Actually, the only thing I have been successful at doing was getting the Excel app to fire up. Beyond that I am left looking at beautiful, although empty, white cells. I'm using VS.Net 2005 latest beta. It seems simple enough... Read a datagrid, send the results to an Excel worksheet. I would use the more accepted method of using Response.Write, but due to our website configuration, things get all screwed up with using a Master page and
tags. If anyone can help me out of this bind, I would be a very happy programmer.
-
Arraylists, Collections & Dictionaries...Ok.. so far so good! Here's what I have: Hashtable table = new Hashtable(); //-- Simple enough! Here's the data: table.Add("0x5628","0x5628, 0, 0"); table.Add("0x0818","0x0818, 1, 0"); table.Add("0x56ED","0x56ED, 4, 0"); Now, I want to enumerate through each element, and "Do stuff" with it... I thought this might work: foreach ( object item in table) { MessageBox.Show((string)item.ToString()); //-- Do other stuff } ...alas, though... it only displays a message as to what the object is, not what it contains. Ideally, I want to return a string from each element: "0x5628, 0, 0" From here I can parse it to my heart's desire... I just can't seem to get to the data portion. Any ideas?
-
Arraylists, Collections & Dictionaries...I need help... Here's my situation: I have an array as: string[] Array_A; byte[] Array_B; The data inside the array looks like so: Array_A: Array_B: 0x5628, 0 0x0818, 1 0x56EE, 0 0x56EE, 0 Now.. I want to add the DISTINCT values of Array_A to an 'Array_List', or collection, or dictionary :-) This new 'List' will look like so: COL_A COL_B 0x5628, 0 0x0818, 1 0x56EE, 0 ... note that the values in the B column do not matter at this point. They will be updated by another process, which leads me to my next situation. I need to update the B column by referencing the values in the A column. void UpdateArrayList(string strCheckThis, byte bData) { if(strCheckthis == Col_A) COL_ B = bData } That code is really bad in that I have no idea to know what row I am actually updating, but it gives you the basic idea of what I need to accomplish. So that's it in a nutshell.. I need to Add, Update and Remove rows in this arraylist (or Collection, or Dictionary =) The last question is: Which object fits this method best? ANY help anyone can offer will be met with swift and decisive praise and adoration... Thank you in advance Ray
-
Bug in CSC.ExeI have a very unusual problem: I am using CSC.EXE to compile a small program with a background image on the main form. CSC seems to compile the program successfully, but when I go to run the program, it gives me a Thread exception error. When I debug the application, this is what I get: ================================================= An unhandled exception of type 'System.Resources.MissingManifestResourceException' occurred in mscorlib.dll Additional information: Could not find any resources appropriate for the specified culture (or the neutral culture) in the given assembly. Make sure "Form1.resources" was correctly embedded or linked into assembly "Pax". baseName: Form1 locationInfo: Pax.Form1 resource file name: Form1.resources assembly: Pax, Version=1.0.1899.20704, Culture=neutral, PublicKeyToken=null ================================================= Now.. If I remove the background image from the form, the program compiles, and runs fine. Using: VS.Net 2003 Enterprise Microsoft (R) Visual C# .NET Compiler version 7.10.6001.4 for Microsoft (R) .NET Framework version 1.1.4322
-
Handling Task SwitchingI have a C# app with 4 forms with "TopMost = True" When I perform a task Switch to another app,(using ), these 4 forms remain on top of the application I switch to. How can I either hide them and bring them back when I switch back to this app, or allow the other application to fall on top of these 4 forms? Thank you in advance for any help!! Ray Sotkiewicz C# infant