Editing WinForms RichTextBoxControl C#
How can you add text to a RichTextBox control and change the font style as you add text? ...
How can you add text to a RichTextBox control and change the font style as you add text? ...
I try to load a simple DLL compiled with GCC in cygwin into a C#.NET application. The DLL looks like this #ifndef __FOO_H #define __FOO_H #if _WIN32 #define EXPORT extern "C" __declspec(dllexport) #else //__GNUC__ >= 4 #define EXPORT extern "C" __attribute__((visibility("default"))) #endif EXPORT int bar(); #endif // __FOO_H T...
I have class: public class MyClass { [XmlElement("Date")] public DateTime Date { get; set; } } It was XML serialized to a file: var myClass = new MyClass() { Date = new DateTime(2010, 09, 24) }; new XmlSerializer(typeof(MyClass)).Serialize(fileStream, myClass); The result: <MyClass> <Date>2010-09-24T00:00:00</Date> </M...
I'm working on a feature request for a .NET test data builder. I need to be able to instantiate classes that only have private parameterless constructors. For instance, I might need to instantiate the following class: public class MyClass() { private MyClass(){} } For most other classes I use the following code: (T)Activator.Cr...
What is the most convenient way of accurately measuring elapsed wall clock time in .NET? I'm looking for something with microsecond accuracy if possible (10^-6 seconds). ...
What exactly happens when a .NET console application starts? In the process explorer, when starting the exe I am wondering why I cannot see a "cmd.exe" process as a parent process for the console application. What exactly is displayed then? Is there a way to replace the "default" console window by another one? I guess this would mean m...
In the spirit of polygenelubricants' efforts to do silly things with regular expressions, I currently try to get the .NET regex engine to multiplicate for me. This has, of course, no practical value and is meant as a purely theoretical exercise. So far, I've arrived at this monster, that should check if the number of 1s multiplied by t...
Hi, Having a problem with StructureMap IOC. I wish to retrieve different concrete implementations of objects that implement the same interface based on labels or names. internal static class InstanceHelper { internal enum Taxonomy { Foo, Bar } static InstanceHelper() { // Initialize th...
Hi, In my web application i am using master page concept, In master page i have login panel using this user can login, after login login panel will not visible and a link button will visible as logout, it is working fine but in one of child pages (content page) i have login panel for login which is in update panel, when user login succ...
Hi fellas, for now i use eclipse on windows and codesourcery compiler to crosscompile c applications for my AT91SAM9RL-EK board. I am thinking of getting a commercial IDE for crossdevelopment for c / c# / .net on arm. Has anyone experience with commercial products for arm development? ...
Is there any C# API to validate a generated XPS document? (i.e. to make sure the file is a valid xps file) ...
I am trying to get MEF to recompose all the parts that it knows about when I update an instance that is exported. Essentially I want to have MEF update all my parts that import a connection string configuration value when it is changed. Everything looks good up to the point where I want to change the instance. If I try to ComposeParts wi...
How to use javascript in .ascx pages ...
Hello, I have two projects, one is a WCF service, the other is an ASP.NET MVC site. The service is to be exposed to multiple consumers, including my MVC site. Both the site and the service require access over SSL. I only have one SSL certificate I can use. Any ideas how I can set these two projects up in IIS? Thanks in advance. ...
So, the situation is I have a C# generic class named Foo with a template parameter T which has the new() constraint. I've declared my classes something like this: class Baz { public Baz() { } } class Foo<T> where T : Baz, new() { // blah blah } And in Python: class Bar(Baz): def __init__(self): """ do various...
Hi, folks. I've created a setup project in VS2008 which installs fine by itself. However projects being installed by this installer depend on components (mainly speaking ESRI) which must also be installed on target machines. There is a separate installer for ESRI that we have and it consists of msi srcipt as well as 6 folders with subfol...
I'm relatively new to using Windows Workflow but we have a requirement whereby all currently active workflows undertake an action based upon a "global event" rather than an event based upon a single instance. e.g. you could have a workflow which is used for the submission and tracking of tickets, with the scenario that when the support ...
Is there an easier/tidier way to deep clone a list of reference types that do not implement ICloneable. Currently have been looping through each object in the list like so: Dim myListCopy As New List(Of ListObj) For Each lo As ListObj In MyList myListCopy.Add(lo.ShallowCopy) Next The object ListObj contains only v...
I have a custom look-less control derived from Control class. It's template is defined in Generic.xaml file. Now I want to add some UI stuff to it (mostly brushes) and want to do that in separate resource dictionary, and then access those stuff from the code-behind feil (*.xaml.cs). See bellow: Generic.xaml (fragment): <ResourceDiction...
i have the js file how can i add that in winform C#, i have developed the front-end and i want to run the js file on button click. i will be thankful to u if u provide the snippet!!!!! I want to run javascript code in windows form thank you. ...