|
My application has a system tray icon. I havent used the NotifyIcon class in .Net, but a different system tray class. I want to display a context menu when the user right clicks on the icon. How can I do this? I havent used the NotifyIcon class because my aplication requires me to show balloon popups too which I haven't been able to achive using the NotifyIcon class. The system tray class that im using has a MouseUp and MouseDown event throught i can get the button that was clicked.
|
|
|
|
|
|
i guess that wouldnt be possible cause the code im using is from planet-source-code.com.
|
|
|
|
|
|
Is there any way, in C# to make an appilcation similar to Rainlender in terms of transparency? If you aren't familiar, you can check it out here
Rainlender[^]
Basically, what I want to do is have the background semi-transparent, but the foreground completely opaque. Is this possible in C#?
|
|
|
|
|
It's possible. But exactly how is buried in the source code for Rainlender, all you have to do is download it. The source code comes with it, but it's in Visual C++ 6.0. You'll have to follow the code and see how it creates its windows and what attributes it's modifying.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Can you give me some tips as what to look for? I haven't done c++ in about 5 years. I'm guessing I can't use any controls and I'd have to render all text in gdi or use images like rainlender.
|
|
|
|
|
Probably something to do with Layered and Transparent windows. Also, modifications to the windows EXSTYLE (Extended Style) attributes, like Alpha and ColorKey.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
How do you spin a process off onto another thread and wait for it to complete? I'm looking for something like when you call ShowDialog and the process stops until the dialog has been closed.
|
|
|
|
|
|
Cool, thanks. I'll take a look at it.
|
|
|
|
|
If your question was how to kick off a seperate process (e.g. another application) from within you current program then the previous answer will be the key, however it looked from your question as if you wanted to kick off a seperate THREAD from within your program, in that case you would create a new thread, start it off and then call Join to wait for it to finish.
e.g
<br />
ThreadStart ts = new ThreadStart(StartExtrapolation);
Thread thThread = new Thread(ts);<br />
thThread.Start();<br />
thThread.Join();
<br />
<stuff><br />
|
|
|
|
|
Yeah, a separate thread yes. I've known how to start different threads and whatnot, just didn't ever know how to wait for one to finish without some kind of event. Thanks.
|
|
|
|
|
This is part of a class libary that I am creating for a web site. I've created a class for a HtmlGenericControl that I want to use on my pages. It creates a box object that I can format easily (via the use of built in methods) and use on my ASP.net web site.
I've created the class, and it all compiles correctly, I can set it's properties and access it's methods, but when I create an instance of the class and try to add the control to the page I get a "null object" error.
Here's my code for the object:
public class ContentBox : HtmlGenericControl<br />
{<br />
HtmlGenericControl BoxTop;<br />
HtmlGenericControl BoxHeader;<br />
HtmlGenericControl BoxBottom;<br />
<br />
<br />
public string BoxHeaderText;<br />
<br />
public HtmlGenericControl BoxContent;<br />
<br />
<br />
string BoxStyle;<br />
public void SetToContentWide() { BoxStyle = "box-wide"; }<br />
public void SetToContentLeft() { BoxStyle = "box-left"; }<br />
public void SetToContentRight() { BoxStyle = "box-right"; }<br />
public void SetToContentRightSidebar() { BoxStyle = "box"; }<br />
<br />
<br />
string BoxHeaderStyle;<br />
public void SetHeaderImportant() { BoxHeaderStyle = "header"; }<br />
public void SetHeaderNotImportant() { BoxHeaderStyle = "top"; }<br />
<br />
<br />
public ContentBox()<br />
{<br />
BoxStyle = "box-wide";<br />
BoxHeaderStyle = "header";<br />
BoxHeaderText = "";<br />
<br />
this.TagName = "div";<br />
this.Attributes["class"] = BoxStyle;<br />
<br />
BoxTop = new HtmlGenericControl("div");<br />
BoxTop.Attributes["class"] = BoxHeaderStyle;<br />
this.Controls.Add(BoxTop);<br />
<br />
BoxHeader = new HtmlGenericControl("h2");<br />
BoxHeader.InnerText = BoxHeaderText;<br />
BoxTop.Controls.Add(BoxHeader);<br />
<br />
BoxBottom = new HtmlGenericControl("div");<br />
BoxContent = new HtmlGenericControl("div");<br />
this.Controls.Add(BoxBottom);<br />
}
When I add the box to the page I simply use:
ContentBox _thebox = new ContentBox();
I can create an instance of the class, I can access it's methods, I can set it's properties, but when I try and use it on the page I get a null object error.
I think that the problem is that although when I create an instance of the class "ContentBox" it isn't being created as a new HtmlControl, but rather a null object.
Can anybody tell me how I get the object itself to become a new HtmlGenericControl when I create an instance of it?
Thanks
|
|
|
|
|
Ok just so I can clarify this.
When I defined the class, I defined it as a an extension of the "HtmlGenericControl" class (as you can see in my above code). I want it to behave like a HtmlGenericControl, I want to manipulate it like a HtmlGenericControl, I basically want it to be a regular HtmlGenericControl.
Since "ContentBox" inherits from the "HtmlGenericControl" class I assume that I am just missing some code that will make the system initialise it as a regular "HtmlGenericControl" (eg. "InitializeComponent()" ).
That's the info that I'm after, how do I tell ASP.net to initialise instances of the class "ContentBox" as a "HtmlGenericControl", so that I can treat it as a HtmlGenericControl in my application?
Thanks
|
|
|
|
|
VS 2005 C# Class Wizard - it is gone? Should I be able to use the class wizard or is it no longer an option?
|
|
|
|
|
I think they removed it in the Express editions to be honest
|
|
|
|
|
Is there an SQLDMO like product for Oracle? I want to be able to manage tables and views from C# code.
Thanks.
|
|
|
|
|
Hi.
I'm trying to hook on to an event which my remote object provides. client and server share the same common library where the event and delegate is defined in an interface.
Anyway, the remoting works, but when I try to use delegates (+=), I get the following message:
"Type System.DelegateSerializationHolder and the types derived from it (such as System.DelegateSerializationHolder) are not permitted to be deserialized at this security level."
I've been searching a lot and see that in 1.1 this could be fixed by setting the 'typeFilterLevel=Full'. However, I can not figure out to set this in .net 2.0 as the 'RegisterChannel' method has changed
|
|
|
|
|
Hi all,
I am very new to DirectoryServices. I created an ActiveDirectory user by using DirectoryServices. I can find that added entry later-on aswell. But I still couldnt figure out that how can I delete an added user later.
I tried
DirectoryEntries.remove("username", DirectoryEntry.SchemalClassName);
as mentioned on MSDN, but its keep on givng me an error like:
Invalid DN name assigned
Can anybody help me?
Thanks in Advance!!!!
|
|
|
|
|
Hi,
I have a form and I don't want it to get focus. Is there a possibility with .net (like setting the focus to a certain window) or do I have to use the win32 api? I'm using visual c# 2005 express edition, so I could make use of .net 2.0.
Thanks
|
|
|
|
|
my tabcontrol's selectedindexchanged event handler runs some code and if an exception is thrown, i set my selectedindex to 0 (the first tab page). but only the tab changes, not the page. the page remains on what was originally changed to. what is going on? i also tried .selectedtab = tpStart; and .selecttab(0); which produces the same weird effect.
|
|
|
|
|
Hmmm not sure why this failing for you - I created a very simple little application and within the SelectedIndexChanged event handler I created an exception and then reset the Tab index to zero and it worked ok.
I have had a look at the System.Windows.Forms.Tabcontrol DLL using Reflector and it seems that the Windows message for SelectedIndexChangING is handled and not passed on so you could override the WndProc for a derived Tab control and handle the code which could potentially cause an exception by trapping the SelectedIndexChanging message and only pass it on to the base Wndproc if no exception was thrown.
Alternatively stick up some code and lets see if there is anything obviously wrong with the code.
Mark.
|
|
|
|
|
the tab it self switches fine. stick some controls in each tab page and you'll see the tab resets to index 0 but not the page. the code i had was simply a tab control, a button, and a label in each tab page. the button click event does "tabControl1.SelectedIndex++;" and the tabcontrol's selectedindexchanged event does "tabControl1.SelectedIndex = 0;" clicking the button or the second tab switches to the first tab as expected and as function but the tab page panel is still at tab page 2. this same code worked fine and also switched the tab page in visual studio 2003, but now in 2005 it does not. however, i found a workaround. visual studio 2005 has a Selecting event for tabcontrol and responds appropriately when setting SelectedIndex to zero. not to mention i can conditionally cancel a tab change .
|
|
|
|
|
Hi,
I'm working on aproximate string matching detecting trademark similarity. I use NGrams, Lev, Editex and
Longest Common Substring algorithm. Recently I find a set of records from another system based on trademark
watching too. The set of records looks like:
(ASELTIN,SLTN,AEI,AEILNST,AS,IN)
(AMBERLITE,MBRLT,AEIE,ABEILMRT,AM,TE)
(ABBEI,B,AEI,ABEI,AB,EI)
where first field is the real trademark name, third field vowels letters, second non vowels, fifth field
are first two letters of trademark and sixth two ending letters.
The fourth field I think is all letters (no repetition) sorted in ascending order.
How can I use this scheme for detecting similiarity??
One way could be take word A and B and use vowels and non-vowels letter with Levenshtaein algorithm.
Like this:
float sim(string wordA, string wordB)<br />
{<br />
<br />
string AVowels = extractVowelsFrom(wordA);<br />
string BVowels = extractVowelsFrom(wordB);<br />
int distance = Levenshtein.distance(AVowels,BVowels);<br />
<br />
...<br />
...<br />
<br />
...<br />
...<br />
return metric;<br />
}
this is fine im working on it, but,
How can I use the fourth field (all letters no repetition sorted in ascending order) for detect similarity??
Any idea???
Thanks in advance
Elvio Fernandez
|
|
|
|