|
When I use a manifest file to enable windows xp themes the calendar control get seriously screwed up. When a range is selected the painting isn't done properly. Has anyone ran into this before? Any solutions to this?
|
|
|
|
|
Is it possible to make ANY string "clickable", just like http:// links can be clicked (if you turn on detect URLS), in a richtextbox? Or maybe make an icon, picture or other objects "clickable"?
/Fredrik
|
|
|
|
|
I think you have to write yout custom richtextbbox control or use axBrowser control.
Mazy
No sig. available now.
|
|
|
|
|
Just add a handler to the LinkClicked event, something such as the following will work:
RichTextBox input;
input.LinkClicked += new LinkClickedEventHandler(Link_Clicked);
protected void Link_Clicked(object sender, LinkClickedEventArgs e)
{
System.Diagnostics.Process.Start(e.LinkText);
}
- Nick Parker My Blog
|
|
|
|
|
But this only works for URLs, I want it to work for ANY type of string..
Fredrik
|
|
|
|
|
Sorry, I didn't see that. I believe you are going to have to subclass the WndProc and watch for EN_LINK message. To receive this message you will also need to send the EM_SETEVENTMASK message as it specifies the event messages to send to the parent window. You should be able to cast the lparam to a ENLINK structure which contain helpful information such as a CHARRANGE structure that will tell you the range of characters. This should at least point you in the right direction but it will require a little work. Hope this helps.
- Nick Parker My Blog
|
|
|
|
|
I am developing a program in which there is dynamically generation of some fields let us take the example of label control now i dynamically generate them after taking input from user. when the user right click on any label i will show him a context menu through which he can select the font, color etc and on the selection of that a different dialog box will be selected now Actual problem is that after the selection of that color or font i want to know on which label control user has right clicked on how i will get that . sorry for poor english
Thanx in advance
Regards
INAM
Inam
|
|
|
|
|
The default delegate is void Delegate(object sender, EventArgs e)
you can get it by casting sender to label
|
|
|
|
|
If I understand you correctly, you need to know control which triggered context menu when you handle MenuItem.Click event. When you handle this event sender is a context menu so it wont't help you much. However, if you handle ContextMenu.Popup sender is the control triggering the event. What you can do is this: create a field in the class where you handle events
object controlWhichTriggeredEvent;
Then create a handler for ContextMenu.Popup :
private void YourContextMenu_Popup(object sender, System.EventArgs e)
{
controlWhichTriggeredEvent = sender;
}
Now when you handle MenuItem.Click , controlWhichTriggeredEvent will contain the latest control clicked by user (you will have to cast it to label of any other control).
|
|
|
|
|
hi all
i wanted to ask about how to ignor keyboard And mouse input
|
|
|
|
|
For your keyboard i your Key_Press event you can set the e.Handled to true. Other way is to implement IMessageFilter and use AddMessageFiletr , so you can handle all events for your application. Look in MSDN for more information and how to use them.
Mazy
No sig. available now.
|
|
|
|
|
I've got a bit of an obscure problem extracting my objects from a HashTable. The basic idea is that the hashtable is populated with objects - which are classes of UTServer. UTServer is a class that contains various variables and a single method - refresh(). I also need to use a hashtable because of the key it uses (since I have to link my hashtable to a listview later on and want it to be as fast as possible)
I don't appear to have any trouble adding the UTServer classes into the hashtable. However getting these out and reading the variables held inside is proving to be difficult.
My Code as follows:
//Declaring the hashtable publicly
Hashtable servers = new Hashtable();
//Adding a UTServer into the hashtable
UTServer myServer = new UTServer();
myServer.ip = "192.168.0.1"
myServer.port = "7777";
myServer.queryOffset = "10";
myServer.game = "ut";
myServer.serverID = 1;
servers.Add(myServer.serverID, myServer);
(when counting the objects in servers - it returns the correct amount)
//UTServer class that is added into the hashtable
public class UTServer
{
public String ip = "";
public String port = "";
public String queryOffset = "";
public String game = "";
public long serverID;
public UT2003Server remoteServer = new UT2003Server();
public void Refresh()
{
remoteServer.Ip = ip;
remoteServer.Port = int.Parse(port);
remoteServer.Protocol = UT2003Server.QueryProtocol.Mixed;
remoteServer.Refresh(game);
}
}
//My code that doesn't work
object obj1 = servers[1];
UTServer b = new UTServer();
b = (UTServer) obj1;
MessageBox.Show(b.ip);
(it should in the messagebox show the ip "192.168.0.1" however it gives a null pointer exception instead.
I would greatly appreciate any advice anyone has, thank you.
Peter
|
|
|
|
|
Peter Mills wrote:
object obj1 = servers[1];
This is a bit of a stab-in-the-dark but the literal 1 you have is an int where as you define UTServer.serverID as a long
Try:
object obj1 = servers[(long)1];
--Colin Mackay--
EuroCPian Spring 2004 Get Together[^]
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
|
|
|
|
|
That's done it! WOW!!!! Thanks for the help, I'd been struggling over it for hours!
Thanks,
Peter
|
|
|
|
|
I have a Cobra LS 1900 bar code scanner that I would like to add in to a C# application. But I have no idea how to do this. The scanner I have connect to the keyboard connection and keyboard is connected to the scanner basically it’s a Y cable. If any one gives some direction which way I should go Greatly Appreciated!!
Thanks so much
CJ
|
|
|
|
|
See .NET TWAIN image scanner[^] here on CodeProject.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I am writing a POS for our school's bookstore and am using a keybaord wedge scanner as you described. In my case I was able to plug the scanner in and read codes right out of the box. I was worried about how I would access it so I thought to try the simplest solution first. I created a simple form with a text box and label. When the text box had focus I scanned a bar code and the numbers (under the bar code) appeared in the text box. Give it a try it may work like mine did right out of the box.
|
|
|
|
|
??? tight budget since I really want to transfer to C# but I don't want to pay 2000.00
Actual Linux Penguins were harmed in the creation of this message.
|
|
|
|
|
|
The compiler is free, you can download it from Microsoft[^].
And you can download a free IDE here Borland[^]
Free your mind...
|
|
|
|
|
As they said, the SDK contains the compiler and is free. If you want a good, free IDE there's also SharpDevelop at http://www.icsharpcode.net/OpenSource/SD/Default.aspx[^].
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I'd also recommend SharpDevelop, while their are a few bugs and annoyances I find it to be excellent.
|
|
|
|
|
As they have spoken so it is. Have fun with C sharp!
...the mind is not a vessel to be filled but a fire to ignited
|
|
|
|
|
Hi there,
Wondering if anyone knows how to send an object that is already serialized in .Net remoting. And listen and read the serialized object that is being received. I want to be able to send a serialized object and recieve and store it in a database, as well as pull a serialized object out of the database and send it through .net remoting.
Right now, I send an object that gets serialized and then deserialized at the other end. Then serialize it again to put it in the database. Then to send it, I pull it out of the database deserialize it and the send the object through .net remoting where it gets serialized again before it is sent.
This is alot of overhead that should not be required. I'm sure there is probably an easy way to do this???
Thanks alot,
I could easily see this being covered in another article but I have searched and can not find anything.
thanks again.
|
|
|
|
|
Another way, yes. Easier, perhaps not. The trick is to use the SOAP in the SoapServerFormatterSink without serializing and deserializing the object. You could override ProcessMessage to intercept the request and response streams appropriately and save these as text (since it is SOAP) to a database. You could then use this server formatter sink in your remoting configuration instead of the default SoapServerFormatterSink which would serialize and deserialize the object.
You could also use a regular sink in the chain to grab the SOAP and put it in a database, but the default formatter sink would still serialize and deserialize the object.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|