.net-3.5

Render winforms controls more smoothly

扶醉桌前 提交于 2019-12-29 08:12:20
问题 My winforms application is rendering very choppy. Is there a technique that can be used to either draw a form off screen, or to have it be hidden until the layout has been processed? Anything to help speed up the visual load of my forms. Thanks for any help. edit: Forms have a couple grids each, and around 20 - 30 additional controls (textboxes / checkboxes). All controls are third party and I don't do any custom painting myself. 回答1: You are getting perilously close to having too many

.NET 3.5 Listbox Selected Values (Winforms)

南楼画角 提交于 2019-12-29 07:16:13
问题 I am BATTLING to get the selected values (please note VALUES not TEXT) from a Winforms Listbox that has multi-select enabled and has been bound to a database table getting the Name (as DisplayMember) and ID (as ValueMember) - I need the ID of the selected items. The listbox control has properties for SelectedValue to get one of the selected items values, but not for all selected items values. The SelectedItems property returns a Listbox.SelectedObjectCollection from which I cannot seem to

Removing a querystring from url in asp.net

£可爱£侵袭症+ 提交于 2019-12-29 07:15:14
问题 HI, I need to remove a querystring when a user clicks a particular LinkButton. So for example if the querystring is http://UserProfileManager.com?UserID=1234 .... when the user clicks on the Linkbutton, I want the url to be http://UserProfileManager.com. The issue is that everything is on one page, and I am using asp:panel to show and hide different areas of the webpage. Any ideas would be appreciated. 回答1: You have several options: 1) In your code behind, just set the LinkButton's URL to the

Converting a string to a float data type

别来无恙 提交于 2019-12-29 07:07:09
问题 I need to convert the contents of a Textbox (which is currency) to a datatype float. Would I convert to single? txtPurchItemCorrectPrice.Text.Trim(); 回答1: If you're dealing with currency then I would use double at the very least, if not decimal . That said you want: double value = double.Parse(txtPurchItemCorrectPrice.Text.Trim()); If you're not sure whether it will be a number or not: double value; bool isOK = double.TryParse(txtPurchItemCorrectPrice.Text.Trim(), out value); 回答2: Do you mean

import csv file/excel into sql database asp.net

风格不统一 提交于 2019-12-29 03:40:10
问题 I am starting a project with asp.net visual studio 2008 / SQL 2000 (2005 in future) using c#. The tricky part for me is that the existing DB schema changes often and the import files columns will all have to be matched up with the existing db schema since they may not be one to one match on column names. (There is a lookup table that provides the tables schema with column names I will use) I am exploring different ways to approach this, and need some expert advice. Is there any existing

XSD: XML files pass validation, but so do XSLs and XSDs

ぃ、小莉子 提交于 2019-12-29 02:02:07
问题 So there's an XSD schema that validates a data file. It declares root element of the document, and then go complexType 's that describe structure. The schema has empty target namespace, document nodes are not supposed to be qualified with a namespace. Recently someone by mistake sent an XSL template in place of an XML data file. That xsl passed validation no problem and was therefore directed to the XSLT processor. Result was basically the free-form text found in the validated XSL. We then

Proper way to dispose a BitmapSource

喜夏-厌秋 提交于 2019-12-29 01:35:10
问题 How are you supposed to dispose of a BitmapSource ? // this wont work because BitmapSource doesnt implement IDisposable using(BitmapSource bitmap = new BitmapImage(new Uri("myimage.png"))) { } 回答1: You do not have to Dispose() a BitmapSource. Unlike some other "image" classes in the Framework, it does not wrap any native resources. Just let it go out of scope, and the garbage collector will free its memory. 来源: https://stackoverflow.com/questions/1591996/proper-way-to-dispose-a-bitmapsource

Programmatically acess Google chrome history

怎甘沉沦 提交于 2019-12-28 15:57:41
问题 I want to index all the user actions and websites in google chrome. i understand that google chrome index all the data in sqlLite database. how can i Programmatically access the chrome web history in my own application 回答1: You need to download the appropriate assembly from the SqLite downloads page Once you add a reference to the SQLite assembly, its very similar to standard ADO.net All the user history is stored in the History database located at the path in the connection string below

Getting configuration settings from web.config/app.config using class library

元气小坏坏 提交于 2019-12-28 13:46:07
问题 Configuration settings in 3.5 is driving me nuts... Help! ;) I have a class library (Named ADI), that needs some configuration settings from the project using it (like connectionstring, filesystem locations etc). I want to define these settings in my Windows Forms/Web Projects App.Config or Web.Config, like other settings. Here is part of my app.config for my windows forms application: <applicationSettings> <PhotoImportRobot.My.MySettings> <setting name="ADIImageRoot" serializeAs="String">

How to reduce the size of an image in C# and .NET 3.5?

孤者浪人 提交于 2019-12-28 05:47:13
问题 I have a screen shot I take in my mobile app. The screen shot takes about 32 KB when saved as a png on a disk. I am sending these to a central SQL Server and 32 KB is too big for that amount of times I will need to store that screen shot (approx 2500 times a day). Is there any kind of trickery that I can do to get it to save smaller? Here is the code I am using now to take it from Bitmap to bytes (to send to the server for storage): MemoryStream stream = new MemoryStream(); _signatureImage