|
Can someone point me in the right direction in creating translucent MenuItems?
I'd rather not get into a debate about why its not advisable, suffice it to say I have a unique tool that really would benefit from it.
I have tried creating a class that derives from MenuItem and overriding OnDrawItem, and then using the Handle to call several Win32 functions that set the window layered property and alpha, but it doesn't seem to work.
I admit I'm a bit lost because I'm not very familiar with Windows Forms.
Thanks so much,
Mattingly
|
|
|
|
|
Ok, I have created a form with nothing on it but a tab page with a single tab, that is marked to anchor to all sides ("top/left/right/bottom"). I then run the app, and size it back and forth, noticing a huge amount of flicker on the label for the single tab page. Additionally, anything I put on the tab page that sizes with it (ie, a Web browser control, a Rich edit box, etc) all flicker terribly as well when sizing.
I've seen other apps that manage to size tab controls without excessive flicker, what do I need to do to eliminate this flicker under C#/.net?
Thanks,
Saren
|
|
|
|
|
SetStyle(ControlStyles.DoubleBuffer, true);
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
in your contructor mite help, also try not to invalidate the form too much.
MyDUMeter: a .NET DUMeter clone "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."
|
|
|
|
|
I've tried that and it doesn't seem to make any difference. How would I avoid invalidating the form? Thus far this is just a single control on a form without any additional code.
|
|
|
|
|
I would appreciate to let me know how I can pause the application run for some time (For example 1 second).
Regards,
Sassan Komeili Zadeh
|
|
|
|
|
Sassan Komeili Zadeh wrote:
I would appreciate to let me know how I can pause the application run for some time (For example 1 second).
using System.Threading;
<font color="green">
Thread.Sleep(1000);
Nick Parker
The only man who never makes a mistake is the man who never does anything. - Theodore Roosevelt
|
|
|
|
|
|
I though I was way past this when I went to program it, but once again C# stumps me and my old C programming habbits...
OK, so I have this stupid little win app I made in vs.net and it has a text box and another text box. You put your first and last name into those text boxes and then you push the 'generate' button of the form. Then the first and second text box's info are put togeather and the person's full name is printed out to the third text box. It's that simple... but rather then elaborating anymore on what went wrong can somebody just give me the code??? I think it would be alot easier, thanks.
-.a.e.
P.S. All I need is all the stuff after the "[STAThread]" thingy.
/\ |_ E X E GG
|
|
|
|
|
Man, somebody should help that kid out... He's dumb...
/\ |_ E X E GG
|
|
|
|
|
eggie5 wrote:
P.S. All I need is all the stuff after the "[STAThread]" thingy.
Um, double click on your button once you have all your textboxes on your form, add the following (or something like it)
private void button1_Click(object sender, System.EventArgs e)
{
this.textBox3.Text = this.textBox1.Text.ToString() + " " + this.textBox2.Text.ToString();
}
Nick Parker
The only man who never makes a mistake is the man who never does anything. - Theodore Roosevelt
|
|
|
|
|
Ohhhh, it works now.... Thanks alot I didn't know about the 'this' thing you put on it... well it worked so who cares....
/\ |_ E X E GG
|
|
|
|
|
You actually don't need to use the "this" keyword when you are dealing with members of the class you're in. They're just there so that when you hit the period, the dropdown list kicks in and offers you a list of members.
Hey, what can I say? I'm a chick magnet...a babe conductor...a logarithm for the ladies.
-Strong Bad from HomeStarRunner.com
Essential Tips for Web Developers
|
|
|
|
|
David Stone wrote:
They're just there so that when you hit the period, the dropdown list kicks in and offers you a list of members.
I used to do that till I realized Alt-Right Arrow does the same.
MyDUMeter: a .NET DUMeter clone "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."
|
|
|
|
|
David Stone wrote:
They're just there so that when you hit the period, the dropdown list kicks in and offers you a list of members.
David there is actually a little history regarding the "this" pointer, this was the best I could do on short notice:
The this Pointer[^]
The this Pointer[^]
Nick Parker
The only man who never makes a mistake is the man who never does anything. - Theodore Roosevelt
|
|
|
|
|
Sweetie,
You don't need to call .ToString() on a Text Property..LOL.
Amber Star
|
|
|
|
|
amberstar wrote:
Amber Star
Who is that a picture of that you have on your profile?
Nick Parker
The only man who never makes a mistake is the man who never does anything. - Theodore Roosevelt
|
|
|
|
|
Hi,
I've used from OleDbDataAdapter and DataSet to work by database (MS Access).
Sometimes I get following exception : " The OleDbCommand is currently busy Open, Executing. "
Can anyone say me, why this exception occurred?
Mehdi
|
|
|
|
|
how can i disable the form's movement and response to a mouse click ?
Jesse M
The Code Project Is Your Friend...
|
|
|
|
|
|
I ask a question about PropertyGrid control in C#.
How can I add new PropertyTab into PropertyGrid control?
I write a class inherited from System.Windows.Form.Design.PropertyTab, but it cannot work, I donnt know what is the problem? When I start the Form, the PropertyGrid control can show properly, but there is no new PropertyTab added in. Who knows the answer?
thanks in advance.
Tony L
email: z2629@263.net
I like C#.
|
|
|
|
|
nobody knows the answer?
I like C#.
|
|
|
|
|
This may be a bit long, but I will try to explain it clearly, so please read on.
I'm writing a web-based file management application (in ASP.NET/C#) that requires keeping track of a hierarchy of the names of folders and their files and subfolders (which may include their own files and subfolders). I need to store this whole organizational structure in memory at all times for quick access and modification. This structure will frequently need to be saved to a single file in some format (text, binary or xml) for storage after the application ends.
At first, I thought of using ArrayLists (one for folders and one for files). Each would be written as a single object into a binary file for storage. But I realize that it would be rather hard to manage nested folders using an ArrayList.
My next attempt is to keep track of the folders using a tree stucture. For instance, the 1st level child nodes will be the 1st level folders, and their children nodes can represent their subfolders, and so on. I need to be using a general tree, not a binary tree because a folder cna have more than 2 subfolders. However, I cannot find a Tree class in .NET anywhere. (There's not even a BinaryTree class).
But I did notice that an XML document resembles a general tree structure, which is what I need. My question is that is it possible and efficient for me to store a whole folder hierarchy in XML format?
I've never worked with XML documents before, but basically, I want to know if it possible for me to keep track of nested folders like this: (my syntax may be far from correct)
<folder name="Main Folder" folderCount="2" fileCount="1">
<folder name="Subfolder 1" folderCount="1" fileCount="0">
<folder name="Subfolder 1a" folderCount="0" fileCount="0">
</folder>
</folder>
<folder name="Subfolder 2" folderCount="0" fileCount="0">
</folder>
<file name="File 1">
</file>
</folder>
And remember, I need to be able to keep on adding as many levels of nested folders as I want. Am I able to do this with an XML structure? Also, can I dynamically add, remove or modify any folder?
MSDN says that ".NET XMLDocument class implements the W3C Document Object Model (DOM) Level 1 Core and the Core DOM Level 2. The DOM is an in-memory (cache) tree representation of an XML document and enables the navigation and editing of this document"
If I understand this correctly, it means that this "XML Document" is still an object stored in memory which will allow quick access. I can then write this object to an XML or binary file at any time.
.NET also has an easy way to load the data from the XMLDocument object into a DataSet. This can be very convenient for me because I can map this DataSet to a DataView and then display it on the screen using a DataGrid or DataList. That would be perfect.
OK. So would you suggest the XML method? Or should I just stop dreaming and find a way to manage nested folder using ArrayLists and DataTables? Please let me know. Thanks.
|
|
|
|
|
<Folder name="Main">
<file>Filename</file>
<file>Filename2</file>
<Folder name="SubFolderOne">
<file>Filename1</file>
<file>Filename2</file>
<file>Filename3</file>
</Folder>
</Folder>
There are XML commands to navigate up and down child nodes.
Not sure how you plan to bind hierarchical data to a DataGrid or DataList. I would imagine you are only referring to a sinlge level at a time.
The collections are based on "object". This can be anything. You can have a collections of collections this building your hierarchical data. An SortedList of SortedLists or ArrayList of ArrayList might work for you. This would mean that each Node was a new Collection.
There is an example of something along that lines at:
http://www.dotnetjunkies.com/tutorials.aspx?tutorialid=560[^]
If you need more than just a file name stored you can build your own class for a data item and use it in your collection instead of just a string.
Rocky Moore <><
|
|
|
|
|
I'm making web based application for file/folder management, and I need to keep a hierarchical structure of folders in memory all the time. Is there some kind of class that supports this "tree-like" organization, or do I have make my own implementation.
For instance, there's no Tree collection class? I do see a BinarySeach() method for the ArrayList class, but I dont see any BinaryTree class.
Anyone have any suggestions for how to keep track of a list of folders and their subfolders. The hierarchy must be dynamic and support adding, modifying, removing folder items at runtime. I really cant use a Binary tree structure because a folder can have many subfolders, not just 2 max.
Thanks.
|
|
|
|
|
To do this, you need to create 2 classes:
TreeItem - this hosts your private and public properties such as Path, as well as a TreeItemCollection
TreeItemCollection - inheriting this from CollectionBase will give you the easiest coding path. In this class you will need to implement standard collection methods such as Add, Insert, Remove, IndexOf etc.
|
|
|
|