|
Hy everyone!
What I want to do is when rightclicking on a ContactItem I do want my proggy to be listed in there with a MenuItem. This should either start my programm or if it is running bring it on top and/or send the data of the selected object to it.
Well the actions which have to take place when being selcted shouldn't be the problem but at the moment I have no idea how to get this MenuItem into the contextmenu when clicking on a contact.
I found samples which created new MenuBars, but that's not what I want. I do want to add an item to an existing menu.
Does anyone of you know how to do this? Well the best thing is this being possible no matter which version of Outlook I do use. Or if the solution depends on which version I do use then I would like to implement it on Outlook 2000 for testing at the moment.
Thanks!
Stephan.
|
|
|
|
|
From my point of view you won't be able to edit any context menu of Outlook, meaning you won't be able to add any item to them, right?
As far as I know you are only able to add an item to a MenuBar. This should be described in the MSDN or elsewhere!
Or is it possible to edit context menus of Outlook? Because if it is possible then I would be interested as well and I would be happy if anyone was willing to provide me some code to show me how to do this.
(This code doesn't have to be this specific like in Stephans request, any "standard code" for editing or adding an item to the context menu is what I would be looking for!)
|
|
|
|
|
I want to add a Link label to a form ,and when a user clicks on it the browser opens and navigate to that link
in the .net help the follwing code has been given
protected void LinkLabel1_LinkClicked(object sender, System.EventArgs e)
{
// Change the color of the link text by setting LinkVisited
// to True.
linkLabel1.LinkVisited = true;
// Call the Process.Start method to open the default browser
// with a URL:
System.Diagnostics.Process.Start("http://www.Microsoft.com");
}
but it didn't work bcos the app enters to the debug mode..any suggestions?
samitha
|
|
|
|
|
thnx 4 the reply
Is this property comes with LinkLabel..?I have gone through the properties but did not come accross such a property...any suggestions?
samitha
|
|
|
|
|
Ummmmm.....no, won't work...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
The NavigateUrl method only works with the WebBrowser object. This person is trying to launch the URL as a seperate process, just like double-clicking on a web shortcut on the desktop.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Try creating a Process object and alter the ProcessStartInfo properties to UseShellExecute . Something like this:
Process webLink = new Process();
webLink.StartInfo.FileName = "http://www.microsoft.com";
webLink.StartInfo.UseShellExecute = true;
webLink.Start();
This will launch the URL as if you typed it in the Start/Run box of Windows.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I use an ordinary tree view inside a dialog, but I wish to write a text saying "No data available"
if the treeview (which is filled with items loaded from files) is empty.
Instead of just adding a node saying "No Data Available", which doesn't look very good,
I'd like to set a flag in the control (The control is a very thin wrapper for the API's treeview)
and when that flag is set draw the string centered in the treeview instead.
I found somewhere on google that this was only possible using Win32 messages with p/invoke.
My question is, how do I do this? I get the handle of the control and send some kind of paint message?
I haven't been into painting in WIN32 very much...
can anyone help me?
|
|
|
|
|
The TreeView class is simply a wrapper around the Win32 TreeView control. You could simply subclass the TreeView and add your P/Invoke statements there. Depending on what you want to do, you could do something as simple as the Win32 function DrawText . The P/Invoke signature looks like this:
[DllImport("user32.dll")]
static extern int DrawText(IntPtr hDC, string lpString, int nCount,
ref RECT lpRect, uint uFormat);
Also, you could just use the Graphics object and call the DrawString method. It all depends on what you are doing, this should get you started.
- Nick Parker My Blog | My Articles
|
|
|
|
|
Thanks for the advice, got it working. What I did was to override the wndproc and catch the WM_PAINT message, upon which a call to CreateGraphics() let me paint what I want.
What I tried originally was overriding the OnPaint method, but that didn't work, never got called I think..? (why?)
|
|
|
|
|
I am getting data from a database, and after some pushing and poking, I have a User object. I then create a list of these Users. I have a couple of accessors:
public string FullName()
{
get
{
return m_name;
}
}
public User GetUser()
{
get
{
return this;
}
}
and
lstUsers.DisplayMember = "FullName";
lstUsers.ValueMember = "GetUser";
and finally
private void lstUsers_SelectedIndexChanged(...)
{
User u = (User)(lstUsers.SelectedValue);
...
}
There must be an easy way than this. Any ideas?
Regards,
Barry
|
|
|
|
|
Barry Lapthorn wrote:
There must be an easy way than this. Any ideas?
Looks easy enough for me!
top secret xacc-ide 0.0.1
|
|
|
|
|
I should have said 'less crap'
The 'callback' is a string. Seems to me like it would be boiler plate code (returning an object handle from a selected list) and perhaps should have been in the CLR.
Regards,
Barry
|
|
|
|
|
Barry Lapthorn wrote:
There must be an easy way than this. Any ideas?
To do what? You really haven't said what your problem is.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
You could also override the ToString() method of your object and make it return the username as a string. As far as the callback goes, why not just insert the object into the listbox. When you want to get it back out, all you need to do is cast it to the appropriate type. Or am I missing something?
Will
|
|
|
|
|
Do you have an example of this?
Regards,
Barry
|
|
|
|
|
My problem is that return the reference to the object from a drop down list must be a common thing, and there's no consistent (e.g. interface) way of doing it, and that the way you have to do it is via a function call back that is a string, and therefore weakly typed.
Regards,
Barry
|
|
|
|
|
Have I asked myself what the best way to enumerate a tree-like structure is (e.g. a TreeView, Directories)? I'd like to ask your opinions about it.
Regards,
Matthias
If eell I ,nust draw to your atenttion to het fakt that I can splel perfrectly well - i;ts my typeying that sukcs.
(Lounge/David Wulff)
www.emvoid.de
|
|
|
|
|
Recursion, if you are not worried about speed, else you will have to go to drawing board and dish up your own fast lookup method (eg a hashtable after recusing thru the entries).
top secret xacc-ide 0.0.1
|
|
|
|
|
Hi
I am developing the application in C#
I am using Magic's TabControl.
My requirement is I want my Tabs to appear Vertically one below each other.
Please can anybody help me.
TabControl from Windows have one property named "Alingment" If i set it to right.It creates TAb page on right side but next tab page gets added in horizontal direction and not vertically down.
Thanks in advance
Archana
|
|
|
|
|
|
How to redirct question to Article's forum?
I am not getting.
Archana
|
|
|
|
|
|
Hello!
I'm using the well-known technique of handling unhandled thread level exceptions with a nice dialog, etc.
However, while it perfectly works on my PC, on a user's PC with just the framework installed, a generic Windows dialog pops up, showing just the "thread ID" and two choices: OK to Debug, Cancel to quit.
My question is: why doesn't it work?
|
|
|
|
|
I have seen this (but very long ago) on win98. I suggest u make sure all the .NET prerequisites are installed and then reinstall .NET just to be double sure!
top secret xacc-ide 0.0.1
|
|
|
|