|
These are all listed in the winuser.h (header file). Depending on the installation on your system you may already have it. If not, Google for that and you'll find loads of references.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
modified on Wednesday, April 15, 2009 11:38 AM
|
|
|
|
|
|
|
If you want the close box to be visible but inoperative (a silly idea if you ask me), then use the FormClosing event and set e.Cancel true. No native code needed whatsoever.
|
|
|
|
|
I used this functionality in an unrelated article[^]. It may be worth looking at the source.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
|
|
Hi Guys,
I would like to create Multiple parent node on may Page where the First Node is independent of the other Node.
Home
page1
page2
Services
page3
page4
Contact
page5
Page6
etc...
How can i create webconfig.sitemap file to have the above structure on a page?
Home service and Contact should be independent links not embebed under Home.
Many thanks
|
|
|
|
|
Try something like this:
<siteMap>
<siteMapNode title="Home" url="default.aspx">
<siteMapNode title="Page1" url="page1.aspx" />
<siteMapNode title="Page2" url="page2.aspx" />
</siteMapNode>
<siteMapNode title="Services" url="services.aspx">
<siteMapNode title="Page3" url="page3.aspx" />
<siteMapNode title="Page4" url="page4.aspx" />
</siteMapNode>
<siteMapNode title="Contact" url="contact.aspx">
<siteMapNode title="Page5" url="page5.aspx" />
<siteMapNode title="Page6" url="page6.aspx" />
</siteMapNode>
</siteMap>
You can add links to any node by placing them in between <siteMapNode></siteMapNode>. Those links will not be present or visible in your menu until you clink on the parent link. See how that works for you.
Josh
|
|
|
|
|
Many thanks.Its really much appreciated.
What i want is to have multiple parent link.So when you click on Home to will not hide service Link.
when you implement like you mentioned it comes with an error.
"Exactly one element is required directly inside the element".
Please advice.
Many thanks
|
|
|
|
|
That's what I get for trying to go from memory! You have to wrap everything in one <siteMapNode></siteMapNode> element. If you are using this with a SiteMapDatasource, you can change the ShowStartingNode property to false if necessary.
<siteMap>
<siteMapNode>
<siteMapNode title="Home" url="default.aspx">
<siteMapNode title="Page1" url="page1.aspx" />
<siteMapNode title="Page2" url="page2.aspx" />
</siteMapNode>
<siteMapNode title="Services" url="services.aspx">
<siteMapNode title="Page3" url="page3.aspx" />
<siteMapNode title="Page4" url="page4.aspx" />
</siteMapNode>
<siteMapNode title="Contact" url="contact.aspx">
<siteMapNode title="Page5" url="page5.aspx" />
<siteMapNode title="Page6" url="page6.aspx" />
</siteMapNode>
</siteMapNode>
</siteMap>
|
|
|
|
|
Many thanks.It works very well Now.
Thanks
|
|
|
|
|
Hello! I recently started writing my first Windows Service project in C#, and I'm at a point now where I have a lot of time to perfect things before I continue.
I was wondering what's considered generally "good practice" with regards to Windows Services. Specifically, the stopping mechanism.
When my service starts, it kicks off a few threads that perform some file manipulation. When the service stops, I want it to shut those threads down gracefully. Ideally, shutting down the service puts the file system in a state where the manipulation can be easily resumed upon restarting the service. So, when shutting down the service, I'd prefer to let one of the threads (if it's currently doing work) finish the works it's already started, but in some cases, this can take several minutes.
Is this considered bad practice, or is this something I shouldn't really be concerned with? Are there other things anyone thinks I should consider?
|
|
|
|
|
It sounds OK to me, though "several minutes" sounds excessive. Is there a way to have them stop after the current operation even though there are still other things to do?
agent00zelda wrote: it kicks off a few threads that perform some file manipulation
Can those be in their own Services?
|
|
|
|
|
Thank you for your response!!
PIEBALDconsult wrote: Can those be in their own Services?
Actually, yes, and they are.. I guess I should have mentioned that part
The way I had it implemented before I made the initial post was I pretty much let it finish everything until it was able to submit the data to the other services. But Windows spazzed out because it couldn't stop the main service until it finished the preceding operations.
What I ended up doing was defining like a project "state" DataTable that could be exported and imported again when the service restarts. Your suggestion was well-taken -- pretty much made the current operation finish and then updated the project state based on that. I don't know if using a DataTable is the best approach, but it seems to work much better, since it takes considerably less time to stop the service.
Still open to suggestions if you or anyone can think of a better approach, though!! I guess I'm in a C# experimentation phase
|
|
|
|
|
Hi folks,
I could please need some help with custom Configuration Sections:
Let me first describe what I want to acheive:
I want to have a Configuration section which consists of several items (I already managed that, it's working fine)
Now each of these items can should have another list of subsitems.
The resulting config file should look like this:
+ section
- parentitem
- childitem
- childitem
...
- parentitem
- childitem
...
As I said I already managed add the section and create the "parent items".
Now I tried using a ConfigurationElementCollection derived class for the collection of
"childitems" but they won't show up.
Does anyone have an idea how I can acheive my goal?
Many thanks in advance.
Stefan
|
|
|
|
|
Hi guys,
Quick question:
I got this class:
public class PresaHidraulica<br />
{
.....
public System.Collections.ArrayList listaRevizii;
}
and i want to overload the operator + to add an object of another class(Revizie) in this ArrayList from this class.
I tried :
public static PresaHidraulica operator +(Revizie r1)<br />
{<br />
}
And i get the error : The parameter of a unary operator must be the containing type
Any suggestions please?
Regards,
Alex
“Be the change you want to see in the world.”
|
|
|
|
|
That means that your parameter r1 is of wrong type: Revizie.
When you overload operator + you must pass in parameter PresaHidraulica
public static PresaHidraulica operator +(PresaHidraulica ph)
{
}
Maybe you should create a method called AddRevizie
public void AddRevizie(Revizie r1)
{
listaRevizii.Add(r1);
}
|
|
|
|
|
The first parameter must be the containing type. In this instance, you should change the operator method signature to public static PresaHidraulica operator +(PresaHidraulica self, Revizie r1)
|
|
|
|
|
Thanks a lot. It worked just fine
here it is:
public static PresaHidraulica operator +(PresaHidraulica p, Revizie r)<br />
{<br />
p.ListaRevizii.Add(r);<br />
return p;<br />
}
Regards,
Alex
“Be the change you want to see in the world.”
|
|
|
|
|
You're very welcome. And thank you for working the code out - too many people here expect to be spoon-fed
|
|
|
|
|
Hi,
this is a bad idea.
When you have integers a, b, c and execute c = a + b; do you expect a or b to change?
That is what your code is doing!
You should not change the value of the operands,
Overloaded operators are not the right solution, create an Add() method instead.
|
|
|
|
|
I totally agree. What you are trying to do is also adding apples and oranges:
foo = 3.1415 + "Hello";
Use an Add method, rather than trying to twist the compiler into effectively allowing implicit casts between unrelated objects.
That didn't make as much sense when I read it back. Try this:
...
int a, c;
string b;
...
c = a + b;
...
You would not expect that to compile, would you?
So why would you expect this to compile?
class AClass
{
private static AClass operator + (BClass b)
...
}
class BClass
{
...
}
...
AClass a, c;
BClass b;
...
c = a + b;
...
|
|
|
|
|
I agree to a point. There are situations where it could be acceptable (the OP's may be one).
To continue your adding apples and oranges analogy, imagine a class FruitBasket that has a List of Apples. Adding a new Apple to the basket via an overloaded + binary operator could make sense. I prefer exposing the list of Apples as a property so it's Add method can be called directly or creating an AddApple method, but it's not 'bad' IMO.
public class FruitBasket
{
private List<Apple> _Apples;
public FruitBasket()
{
_Apples = new List<Apple>();
}
public static FruitBasket operator +(FruitBasket basket, Apple apple)
{
basket._Apples.Add(apple);
return basket;
}
}
public class Apple
{
public Apple(string name)
{
Name = name;
}
public string Name
{
get;
set;
}
}
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
I see what you are saying, that there may be instances where it could be acceptable.
I am not sure though, that it adds anything usefull over using an Add method - at least you expect
fruitBasket.Add(apple); to change fruitBasket without looking at the implementation. I wouldn't expect
foo = fruitbasket + apple; to result in a change in foo and fruitBasket at first view. Surely, good practice would say "don't do it"?
Just a thought, not an arguement...
|
|
|
|