Hi,
I want to display a tooltip when the mouse hovers over a link in my custom rich edit control. Consider the following text :-
We all sleep at night .
In my case the word sleep is a link.
When the user moves the mouse under the link , in this case "sleep", I want to display a tooltip for the link .
The follwing came to my mind, bu...
The prog in c#:
private void listBox1_Click(object sender, EventArgs e)
{
String data = (String)this.listBox1.SelectedItem;
data = data.TrimEnd(new char[] { '\r', '\n' });
try
{
ip = Dns.GetHostAddresses(data);
}
catch (SocketException ex)
{
MessageBox....
I've got an Entity Data Model with Product and Family types. Each Product has one Family.
I'm using this model with an ASP.NET MVC web site. I want Family DropDownLists on the Create and Edit Views of my Product controller.
How Do I Use Entity Object Navigation Properties in a DropDownList on my Strongly Typed ASP.NET MVC Create and ...
Would it be better to transpose a Microsoft .NET program to standalone by modifying the existing code, or to just use the existing code as a reference? By standalone, I mean that the .NET framework (nor any other) would not have to be installed on the machine. Preferably, I'd prefer the option which would take the least time, even if it ...
Does anyone know of a good impl of bcrypt, I know this question has been asked before but it got very little response. Im a bit unsure of just picking an impl that turns up in google and am thinking that I may be better off using sha256 impl in the System.Security.Cryptography namespace, at least then I know it's supported! What are y...
Whenever I add a new class to a Visual Studio (C#) project, I get the following usings automatically:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Additionally, the following DLL references are added if they weren't there already:
System.Core
System.Data
System.Xml
I'd like to prevent VS f...
I'm making a .NET 3.5 app with a form that draws a partially transparent black background. I'm overriding OnPaintBackground to accomplish this:
protected override void OnPaintBackground( PaintEventArgs e )
{
using ( Brush brush = new SolidBrush( Color.FromArgb( 155, Color.Black ) ) )
{
e.Graphics.FillRectangle( brush, e....
Hi, Is there any tool for showing the cyclomatic complexity for Visual Studio in the left hand bar where the debug symbol goes?
I seem to remember there was an addin for Resharper but don't think it works in 4.5
Has anyone seen any similar tools, other than the built in support in VS
...
I've read about 10 different questions on when and how to override GetHashCode but there's still something I don't quite get. Most implementations of GetHashCode are based on the hash codes of the fields of the object, but it's been cited that the value of GetHashCode should never change over the lifetime of the object. How does that w...
I have a global event created and set/reset in a native C++ process that are created like this:
HANDLE hGlobalEvent = CreateEvent(NULL, TRUE, FALSE, _T("Global\\MyEvent"));
Is there any way (even if it's with a library not written by MS) to register for one of these events in a .NET (C#) process so that I standard .NET events handlers...
We need to build a system capable of processing 40,000 messages per second.
No messages can be lost in case of any software or hardware failures.
Each message size is about 2-4Kb.
Processing of a message consists of validating the message, doing some simple arithmetical calculations, saving result to database and (sometimes) sending no...
I am trying to indent after a newline when using an XmlTextWriter
So essentially i want this
<?xml version="1.0" encoding="utf-16"?>
<element>
a
</element>
but using the code below i get this
<?xml version="1.0" encoding="utf-16"?>
<element>
a
</element>
Here is my current test harness
[Test]
public void XmlIndentingTest()
{
...
Hello, I'm .net newbie starting one project for fun.
I'm using list box filled with some city names so user can pick one.
Every city class has name and UID. How do I know which city user clicked on?
Obviously, I can get text of selected item, run through city list and
find one by name but that seems stupid.
Is there equivalent to MFC S...
In .NET can I use any string as a dictionary key? This is part of a templating engine and I'm planning allow users to add their custom headers and values.
Headers will be something like "Value of X" or "Summary of Analyse & XYZ Reports", I'm worried if they would get an exception in a rare character or something like that.
I assume th...
Given two objected that do not contain reference loops within them, do you know a method that tests their equality in a "generic" way (through reflection)?
I basically want the same semantics as struct equivalence, only on classes.
...
In the MySQL .NET provider, you can use named parameters in the syntax:
?parametername
Now, I'm trying to create a named parameter for a parameter that will be used in an 'IN' list, e.g. :
select * from mytable where id in (?ids)
How can I use a named parameter with this, if I use varchar, it will add quotes before and after the li...
How do I loop through all the controls in a window in WPF?
...
i have a listoddata and a list of thread in main thread .i am passing each element data of list to corresponding thread.want to main thread to wait untill all of thread are executed.
for (int i = 0; i < listOfThread.Count; i++)
{
listOfThread[i].Join();
}
// code after all of thread completes its...
Hi my teachers!.
I want the best way to get mouse position for Form.
I,m now set the values of mouse position in variables to get them in another methods "Like Form1_Click".
Is there any better way to do that??.
Thank you very much.
...
I have a datagrid populated by a Linq query. When the focused row in the datagrid changes I need to set a variable equal to one of the properties in that object.
I tried...
var selectedObject = view.GetRow(rowHandle);
_selectedId = selectedObject.Id;
... but the compiler doesn't care for this at all ("Embedded statement cannot be a d...