Answer Questions
Jim Perry binding datatable with image as byte[] to datagridview
Try to bind datatable with image stored as byte[] to datagridview Way 1: Auto generation of columns of datagridview / /init dataGridView1.AutoGenerateColumns = true; DataTable dt = new DataTable(); Bitmap bmp = new Bitmap("test.bmp"); //convert test image to byte MemoryStream ms = new MemoryStream(); bmp.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp); byte[] buf = ms.ToArray(); //binding dt.Columns.Add("Pic"); dt.Rows.Add(buf); dataGridView1.DataSource = dt; Result of Way 1: DataGridView shows cell with text "System.Byte[]" ################################## Way 2: Manual generation of columns of datagridview //init ...Show All
RickKr format a specifc cell in datagridview
I want to format a specfic cell in a datagrid id dgv2.item(0,1).backcolor = color.red this is what i have but it does the who col i only want row 0 Col1 dgv2.Columns(1).DefaultCellStyle.BackColor = Color.Coral How about using DataGridView's CellPainting event Something like: private void dataGridView1_CellPainting( object sender, DataGridViewCellPaintingEventArgs e) { if (e.ColumnIndex == 1 && e.RowIndex == 0) { if ((e.PaintParts & DataGridViewPaintParts .ContentBackground) == DataGridViewPaintParts .ContentBackground) {   ...Show All
rayden Cannot get the tooltip balloon to show on a listviewitem
I have multiple controls on a windows Form and I get the balloon for all my labels but I always get the standard rectangular box for listviewitems. Is there any way to get around this the listview view mode is set at details if that helps thanks in advance Here is a solution that may work... You can just have a generic toolTip object (just drag it into your form from the toolbox), set the toolTip object on the listview, and depending on which item it is over on the listview (use mouseposition to check), change the toolTip text to what you need. In order to do this, you would have to detect mouse movement on the listview object. To do so, add this line to your Form.designer.cs ...Show All
motorola DataGridView
Hi There, I created an application in which a Form has simple datagridview. DataGridView displays account information. --------------------------------------------------------------------------------------- AccountNo Name Address Amount ------------------------------------------------------------------------------------- 111111 ABC ABCD 5000.00 222222 DEF PPPP -200.00 Amount is refreshed every 5 seconds. What I want to do is......... if amount becomes less than zero then I want to set the background color of amount cell for that particular row to red and if it becomes greater than zero then make it green. Since amount chages every 5 seconds.......... background color ...Show All
kkennedy1008 SLOW response from datagridview when setting a cell value.
I have an application that is using the new DataGridView in Visual Studio 2005. Its kind of a complicated grid in that the columns are mixtures of different types of cells (combo box, text box, and check box cells). This application is sort-of mimicking an excel spreadsheet. Anyway, the roadblock that I am up against now is that when I set a cell value in my grid, it is VERY slow. I have only about 120 rows and 5 columns in my grid. When I step through the code to figure out what is so slow, everything executes fine except when I execute this line: Grid(ColumnIdx, RowIdx).Value = strParms When I execute this in the debugger, I can make out text in the status bar of the IDE that flashes up really fast and continually and says ...Show All
LutzH LinkLabel - AutoEllipsis on and automatic tooltip
I wanted someone to confirm this for me before I go nuts. If I put a LinkLabel on a standard form, set AutoEllipsis to true and AutoSize to false and make the Text of the LinkLabel larger than the supplied region, the text is shown with an ellipsis and a tooltip will automatically appear with the entire text when the pointer is over the control. If I do the same on a UserControl instead of a standard form, the tooltip does not automatically appear when the text is too large. Is this by design I'm assuming that the standard form might be supplying addional services to the LinkLabel control. I wouldn't be so up in arms about this but, I have LinkLabels in UserControls and they do not automatically tooltip so I have to figure ou ...Show All
Ofir Epstein Intercepting the BindingNavigator Delete command
The BindingNavigator control that is created when using the Data Sources wizard has a button for deleting records. I would like to intercept this delete and confirm with the user first and then cancel the delete if the user does not confirm. When I double click on the delete button at design time, it does create a code stub for me but it appears that the delete has already happened when this code executes. Is there anyway to cancel the delete at this time Dave Be sure to check the number of records, because if it's NULL, it cann't be removed and ocurs an error: if(BindingSource.Count > 0) BindingSource.RemoveCurrent(); The BindingNavigator has a property called 'DeleteItem'. Cha ...Show All
Jameslee20 Making a scrollable panel scroll with mousewheel just by hovering mouse
Hi, I have a particular problem with a possible solution and I am interested in hearing peoples opinions if it is the right way to go about it (or not ) Some applications I have come across, such as Firefox, will allow the user to scroll the document window just by hovering the mouse over the display area and using the mouse wheel. You don't have to focus / select the display area first. With Firefox, the address bar can have the focus and the keyboard input but you can still scroll the document. Contrasting with IE and Visual Studio, you have to click into the document area before it responds to mouse wheel messages. In my winforms app, I have a tab control with several scrollable tabpages as well as scrollable panels in ...Show All
incendy Personalize a datagrid
Hi, Is there a way to define (via code) the size of each column after filing it And hide a specific column without change the datasource Thanks Ooooh,you said DataGrid , sounds like you're using VS 2003, for DataGrid,it's a bit tough,you can do as: This .dataGrid1.DataSource = dtBook; //a datatable named "dtBook" DataGridTableStyle tbStyle = new DataGridTableStyle(); tbStyle.MappingName = "dtBook"; this .dataGrid1.TableStyles.Add(tbStyle); this .dataGrid1.TableStyles["dtBook"].GridColumnStyles[0].Width = 200; this .dataGrid1.TableStyles["dtBook"].GridColumnStyles[1].Width = 0; Pay attention at the statement bolded, I set its width to 0, this make the column ...Show All
Todor Todorov Reading data from another form
Everything I have read on the web says I can do this. I have followed the setup of others that seemed to have solved their issue, but it still fails for me. I want to read data from a textbox on form1 from form2. Since I declared frmVendor_list as public and I set the textbox1 on that form to have a modifier of public, I assumed I would be able to access the text in the textbox. But it will not build, throws an error 'Textbox1 is not a member of system.windows.forms.form If I add the line: dim vendor_list as form1 right above the call to the textbox from form2 and refer to the textbox as vendor_list.textbox1.text - the error goes away and it compiles. But it throws an error at runtime that the textbox1 contains a null reference ...Show All
Sarah Cartwright Adding icon inside TextBox
How to add icon inside textbox Thanks the following article might be useful http://www.vbaccelerator.com/home/NET/Code/Controls/ListBox_and_ComboBox/TextBox_Icon/article.asp ...Show All
krascso Working with a MDI and ToolBar
This app uses the Main form TAMain as container for several small windows with specific functionality, for instance, one interface withe the user for adding and maintaining Item Details, another for Users, another for Products, a so. Mi problem is that I got a main ToolBar set on the right of the screen that's the one that open such an such windows and makes sure no two windows are open at the same time. For instance, once the Items window open I'm settin the enable propperti of that particular button to false and all other buttons; since each window is open as a Dialog Window, the user won't be able to use any othe window but the activa dialog and its controls, I'm usign theregular : ItemDescription ProductsWindow = new ItemDescr ...Show All
JUNJIE.HONG Datarow Compute Method / Object conversion error
I can't get this working. I thought an object could be converted into anything. I am trying to fill a label or textbox (I don't care which) with the results of the computed column (sum). I am close but I get an object to string and integer conversion error. I also tried the CType conversion and .ToString at various locations. Dim total As Object 'instantiate container Dim filter As String = "'MyIDColumn' > 0" 'single quotes around filter column Dim dt As DataTable = DataSet1.MyTable1 'instantiate table total = dt.Compute("Sum(MyNumberColumn)", filter) 'perform addition and filter Label1.Text = total.toString 'show sum of column TextBox1.Text = total.toString 'show sum of column (Reference taken from ...Show All
jewelfire Common Language Runtime Debugging Services Application has generated an exception that could not be handled
Our custom got an error when startup our .NET windows form application. XXXXX.exe - Common Language Runtime Debugging Services Application has generated an exception that could not be handled Process id=0x654(1620), Thread id = 0x5b0 (1456) Click OK to terminate the application Click CANCEL to debug the application If they click on "CANCEL" then following error message appears: Registered JIT debugger is not available. An attempt to launch a JIT debugger with the following command resulted in an error code of 0x2(2) Please check the computer settings cordbg.exe !a0x654 Click on Retry to have the process wait while attaching a debugger manually. Click on Cancel to abort the JIT debug request We can not duplicate this p ...Show All
Ron DeSerranno - MOBIFORM About FileSystemWatcher
hi to all.. my question is about the style of work of a FileSystemWatcher.. i mean how it does work when only one or all of the files have changed and for example while i am watching 50 .doc files in a folder and 20 of them are changed by different users how can i do some changes on only the changed files. if using a for loop how can i determine the number of the changed files. how can i do that Hi, The following link should help you http://msdn2.microsoft.com/en-us/library/system.io.filesystemwatcher.changed.aspx You use the changed event. There is a good example on the page. HTHs, James So using the example // Define the event handlers. pri ...Show All
