|
Here's one way:
myTextBox.Font = new Font ("Tahoma", 8, FontStyle.Underline);
/ravi
|
|
|
|
|
Like the other two examples have said, you need to update the Font's underline characteristic. With a Textbox, however, you cannot underline specific text, just all or none. RichTextBoxes allow other functionality. Check out the MSDN pages on them if you'd like more information.
|
|
|
|
|
how can i underline a text in the text box .. as it is done in the Ms.word to indicate spell error
bia
|
|
|
|
|
in vb.net 2005
textbox1.font.Underline=true
that is innef for underline in textbox text
jeni_yash@yahoo.co.in
|
|
|
|
|
Hi everybody, can we use c# to build device drivers, or we must stick to c++?
|
|
|
|
|
You don't have to, however, as most of your code will be unmanaged you might as well use C++.
only two letters away from being an asset
|
|
|
|
|
As C++, C# is advance of C++ so whatever we can do with C++ can also be done through C#
jeni_yash@yahoo.co.in
|
|
|
|
|
anilsolanki wrote: C# is advance of C++
Uhhh...No, it's not. And you do NOT want to write drivers in C#. There's too much you have to rewrite in C# code, plus the overhead of the MASSIVE amount of P/Invoking and Interop you'll have to do.
Like the other poster said, it's not worth it because most of the resulting code will be unmanaged anyway. So why go through the huge hassle of converting the DDK to support C# when you're not really going to use the .NET Framework anyway?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
|
I recommend buying a book on C#. C# is a step forward frm JAva. It has little to do with C++.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
There is no way one would want to do this, since it would cause the driver to incur the overhaed of loading the CLR. Drivers should be written in C++, not C# or managed C++.
|
|
|
|
|
|
Hi,
Here is my code:
Form_Leave()
{
this.Opacity = 0.5;
}
Form_Enter()
{
this.Opacity = 1;
}
If I have 10 controls in my form, I need to add this Form event handler to each and every controls in the form. And when I do that when Mouse_Leave and Mouse_Enter occur my form get flickering.
Is there any other way to avoid flickering and adding event hander to each and every contol.
Thanks in advance
Muthu.
|
|
|
|
|
Use SuspendLayout() , do what you have to do, ResumeLayout() (and eventually Refresh() )
SkyWalker
|
|
|
|
|
I still have flickering even after using Suspend/Resume Layout.
Thanks
Muthu.
|
|
|
|
|
rather than handling this with an event handler in each control, do it all in the main form's event handler:
this.SuspendLayout();
foreach( Control ctl in this.Controls)
{
ctl.opacity = x;
}
this.ResumeLayout();
|
|
|
|
|
Control doesn't have Opacity property!!!
Thanks
Muthu
|
|
|
|
|
Controls don't have Opacity properties. It applies to the Form, not it's controls. The entire form has to change its opacity, not the controls.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I want to know which ip/ports(sockets) are currently in use. How can I do that?
Danger!
|
|
|
|
|
|
led mike wrote: Loop and Bind
Oh no! This is not a really applied method! It's too time consuming! Certainly, the OS has a list of ports that are currently in use, or vice versa, a list of available ports. How can I ask the Framework to give me this list?
Danger!
|
|
|
|
|
|
Absolutely Fantastic, Thanks a lot!
Danger!
|
|
|
|
|
I have the same thread in the MSDN forums, but sadly no one has replied so far. I hope that someone can help me out here
Upon invoking a Delegate created from a DynamicMethod, I receive the following error "Common Language Runtime detected an invalid program.".
It's a bit hard to shape the problem verbally, but I'll try my best, since I would need to post a lot of source code - however, here's my got at it:
I have a Method Manager class. This class allows me to story a collection of MethodInfo objects into a Dictionary object, whose key is a Type.
class MethodInfoCollection: List<MethodInfo> { ... }<br />
<br />
Dictionary<Type, MethodInfoCollection> m_Methods; ...etc
Let's say I'd want to call a specific method for each Key of this m_Methods Dictionary. I would iterate into each MethodInfoCollection and then into each MethodInfo object, checking if the names matche, and then executing via Invoke(); . These MethodInfo objects are coming from different objects instances.
CallMethod("Update"); // this calls every "Update" method found in the m_Methods collection.
Since MethodInfo.Invoke() is way much too slow for my needs, I thought I could come up with another method, that is using DynamicMethods.
I already have a List<string> (m_InterfaceMethods ) containing all the possible method names (like "Update" in the above CallMethod call).
My intent is to create a lookup table of Delegates. So, it would be a
delegate void SpecificDelegate();<br />
<br />
Dictionary<string, SpecificDelegate> m_MSILMethods;
- for every known method name, there will be a dynamically created method which in turn will call all the methods - whose names are matching the string Key. I hope this is clear enough.
<code>public static void CallMethod(string MethodName)
{
m_MSILMethods[MethodName].Invoke();
}
</code>
How to create a DynamicMethod which will invoke in its IL a series of methods? Those methods are stored in a MethodInfo class. Which instructions do I require for it to work?
MSIL Method Generator:
<code>DynamicMethod m_MSILMethod;
ILGenerator m_ILGenerator;
foreach (string m_InterfaceMethod in m_InterfaceMethods)
{
[...].
m_MSILMethod = new DynamicMethod(String.Format("Managed{0}", m_InterfaceMethod), null, null, typeof(MyManager));
m_ILGenerator = m_MSILMethod.GetILGenerator();
foreach (Type m_Type in m_TypeExecutionOrder)
{
foreach (MethodInfo m_Method in m_Methods[m_Type])
{
if (m_Method.Name == m_InterfaceMethod)
{
m_ILGenerator.Emit(OpCodes.Ldarg_0);
m_ILGenerator.Emit(OpCodes.Call, m_Method);
}
}
}
m_ILGenerator.Emit(OpCodes.Ldnull);
m_ILGenerator.Emit(OpCodes.Ret);
m_MSILMethods.Add(m_InterfaceMethod, (SpecificDelegate)m_MSILMethod.CreateDelegate(typeof(SpecificDelegate)));
}</code>
Looks like the DynamicMethod generator is not working, perhaps a flaw in the MSIL emitted.
It all boils down to this question, perhaps: How to create a DynamicMethod which will invoke in its IL a series of methods? Those methods are stored as MethodInfos. Which instructions do I require for it to work?
Thanks in advance for your time and any help is much appreciated.
|
|
|
|
|
I was able to reproduce your problem and figure out the offending IL statement. It's the m_ILGenerator.Emit(OpCodes.Ldnull); before you emit the ret statement. Let me know if it still reports invalid programs after you removed the statement.
|
|
|
|