in WinForms I can use Control.Scale to scale control larger. when I do that, all child controls are repositioned and scaled correctly, but font size remains the same.
is there an easy way to force font to scale up/down as well? or is the only way for me to manually update font for all controls when control is being scaled?
background: ...
I am trying to deserialize a stream but I always get this error "End of Stream encountered before parsing was completed"?
Here is the code:
//Some code here
BinaryFormatter b = new BinaryFormatter();
return (myObject)b.Deserialize(s);//s---> is a Stream object that has been fill up with data some line over here
...
Given: Constructing an ADO Connection object from one thread and giving it to another thread is forbidden. The two threads are different apartments, and even though the first thread will never touch it again (not even maintain a reference to it!), it doesn't matter.
That ADO Connection object was created by ThreadA, ThreadA is the onl...
I'm porting a Forms app to a VB.NET web app, and one of the feature the users really liked was the ability to narrow the possible choices as the user typed in a search box. The search itself goes against multiple tables and columns (and takes several seconds), so it's not a simple AutoComplete or anything. What's the best way to allow th...
Hi,
I want to build an application that will allow my customers to send marketing information by e-mail. This will be a carefully monitored tool used for legitimate bulk mailing only. It's going to have all of the necessary 'unsubscribe' functionality etc.
The solution will be built using VB.NET.
My question relates to the best way to...
I have found an example for encrypting a web.config during installation here, but my app is a windows service. The aspnetreg_iis method works only for web.config files.
I know how to programatically encrypt the config file, but I don't think I can do that using WiX. Am I wrong? Any ideas?
...
Lets say I have a table in a sql server 2000 database called TransactionType:
CREATE TABLE [dbo].[TransactionType](
[ID] [int] NOT NULL,
[Description] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
CONSTRAINT [PK_TransactionType] PRIMARY KEY CLUSTERED
(
[ID] ASC
) ON [PRIMARY]
) ON [PRIMARY]
I then have a t...
In .NET is there a function that tests if a string is syntactically a correct path? I specifically don't want it to test if the path actually exists.
my current take on this is a regex:
([a-zA-Z]:|\\)?\\?([^/\\:*?"<>|]+[/\\])*[^/\\:*?"<>|]*
matches:
c:\
bbbb
\\bob/john\
..\..\
rejects:
xy:
c:\\bob
...
I have a situation where I need to work with a datagrid and adding columns dynamically in PageInit as the grid has a few conditional requests that it must handle. I'm moving along easily with BoundColumns, and ButtonColumns, those are easy. The problem is with the creation of a TemplateColumn via code. I have found examples out there ...
I have tried to implement simple ViewPage caching with ASP.NET MVC, however I cannot get the page to render correctly into a custom HtmlTextWriter when it has a master page.
I have tried overriding Render. If I simply call the base implementation, then everything renders correctly. If I render to my own writer and then write that string...
I'm using MBUnit Framework for unit testing and looking for a good test runner.
MbUnit's runner is fast however lacking lots of stuff such as
You can't set execution path
It's collapsing all trees in every run which drives me crazy
And almost all other test runner provides so many extra quite and lovely features
I used Zanebug, but...
I'm trying to attach a PDF attachment to an email being sent with System.Net.Mail. The attachment-adding part looks like this:
using (MemoryStream pdfStream = new MemoryStream())
{
pdfStream.Write(pdfData, 0, pdfData.Length);
Attachment a = new Attachment(pdfStream,
string.Format("Receipt_{0}_{1}.pdf", jobId, DateTime...
public static IQueryable<TResult> ApplySortFilter<T, TResult>(this IQueryable<T> query,
string columnName)
where T : EntityObject
{
var param = Expression.Parameter(typeof(T), "o");
var body = Expression.PropertyOrField(param,columnName);
va...
Duplicate post, see: When do you use the "this" keyword?
On almost every project I worked the "This" operator is used, when i start developing i was told that it is a good practice. is this really necessary does it gives you more readability?
...
I have code running in a loop and it's saving state based on the current time. Sometimes this can be just milliseconds apart, but for some reason it seems that DateTime.Now will always return values of at least 10 ms apart even if it's only 2 or 3 ms later. This presents a major problem since the state i'm saving depends on the time it w...
Hi,
I have this .NET web app that draws a table in Page_Load.
Then after that it handles the events, which should change the table drawn in Page_Load.
This is very inefficient.
Is there a way to execute the code (which draws the table) after it finishes handling all events? (instead of doing it in Page_Load)
Thank you in advance.
...
I have written an Application Desktop Toolbar (a.k.a AppBar), it works great except for the fact that if I kill the process, the AppBar code never gets a chance to cleanup by sending an ABM_REMOVE. The problem is that this basically screws the users desktop up. The AppBar is written in .NET using interop code.
Does anyone know of a way...
Is there any easy way to add a using statement to every class I create in a project without having to write
using SomeNamespace;
in every file?
[edit]
I could add a template I realise but I'm talking about doing it for every file in an existing project.
...
Hi,
I've got this problem with dynamically created TextBox.
When the TextBox is created in PageLoad, it's TextChanged event was fired.
But when I dynamically delete and recreated the TextBox, the TextChanged was not fired.
This is the code:
.aspx
<asp:Table ID="Table1" runat="server">
<asp:TableRow>
<asp:TableCell ...
I'm working on a little web crawler that will run in the system tray and crawl a web site every hour on the hour.
What is the best way to get .NET to raise an event every hour or some other interval to perform some task. For example I want to run an event every 20 minutes based on the time. The event would be raised at:
00:20
00:40
01:...