|
|
How can i create Windows Forms in C# that look like the windows in Vista (e.g. Only Title bar is partially transparent with a background image)?
I found here one article 'VistaButton' by Xasthom. But i don't know how to do that with Windows Forms.
Thanks
Rakib
|
|
|
|
|
The guy below you is asking the same thing. The answer is, you need to owner draw EVERYTHING that the system usually draws, or find a library that does that for you.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hello
I created a windows App invista using C# caled VS Payroll 2008 (you can check it out on download.com) however I noticed when it is opened in XP it looks like junk. How can I make it look better like in vista?
-Will
|
|
|
|
|
By downloading or writing controls that mimic the look of Vista instead of letting Vista do it. But, I don't think XP look apps look like 'junk', unless there's something specific to your app that you need to clean up.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
yes, all the forms and colors are useing "system" becuse it looked great in vista but the "system" settings give it a VERY grayed out and low tech look. How should I go about downloading the controls that mimic vista to depoly to xp users?
|
|
|
|
|
willpv2 wrote: How should I go about downloading the controls that mimic vista to depoly to xp users?
Gee. Um... google ? I'd search this site first, then do a general web search.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hello All
i am trying to add label controls into a listbox control in the runtime
i am using this code
private void button1_Click(object sender, EventArgs e)
{
Label l = new Label();
l.AutoSize = true;
l.Font=listBox1.Font;
Random R=new Random();
int r=R.Next(0,255);
int g=R.Next(0,255);
int b=R.Next(0,255);
l.ForeColor = Color.FromArgb(r, g, b);
l.TextAlign = ContentAlignment.MiddleCenter;
l.Text = "Experement";
listBox1.Items.Add(l);
label1.Text = listBox1.Items.Count.ToString();
listBox1.Invalidate();
}
i think it have no problems, but i cant see anything added to the listbox items.
any help?
|
|
|
|
|
Why are you adding Labels to a ListBox? What are you trying to achieve with this?? i can't think of any good reason to do this.
|
|
|
|
|
You spelled "Experiment" wrong.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
I am surprised that this builds and runs. A list box Items collection is a collection of ListBoxItems, I'd have thought.
This is winforms, it's not WPF.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
You wouldn't think it was the season of goodwill, given the responses from the first few people, would you?
OK - your problem is that, while ListBox items are a collection of Objects, it has no idea how to display a label - so you get nothing.
Your code will show (in label1) that the items are added to the collection - if you want to draw each in a different colour, then you will have to help the listbox by drawing each item yourself.
See here[^] for a quick and dirty example - it should give you the idea to work on anyway.
And to the other responders - why the -ve attitude, guys? Time to pull some heads out of some arses, I say!
If I knew then what I know today, then I'd know the same now as I did then - then what would be the point?
.\\axxx
(That's an 'M')
|
|
|
|
|
Father Christmas wrote: And to the other responders - why the -ve attitude, guys? Time to pull some heads out of some arses, I say!
Because there's just wayyyyy too many people running around trying to do stupid things for the most insiane reasons and we're kind of tired of wasting our time on something that doesn't solve the real problem that the user didn't tell you about.
You haven't been around here for the last 5 years watching the quality of questions just plummet to unbelievable levels. I blame it on the outsourcing boom, which generated a huge demand for computer jobs in third world countries where the number of PC's per capita is so low that it could not possibly generate the level of experience required to support the West's hunger for IT personell.
|
|
|
|
|
OK - I can see your point (and your response, frankly, wasn't the worst) but it was pretty obvious to me tha the OP had a simple conceptual problem - I have a collection of objects in a list box, I am adding labels to it, and I am not seeing anything.
Now you said
"Why are you adding Labels to a ListBox? What are you trying to achieve with this?? "
Q 1 and 2 are good questions - by assumptions may be erroneous and further clarification would be good (in case he doesn't just want colourful items in the listbox, but has some other goal) but your statement "i can't think of any good reason to do this. is, I feel, negative and, frankly, pompous. The OP has, it seems, made a mistake in trying to achieve something (presumably colourful items in a list box) and rather than taking a positive approach, you come over all uppity.
And no, I haven't "been around here for the last 5 years watching the quality of questions just plummet to unbelievable levels". However, if this has been the general level of response in some attempt to get a better standard of question - then it plainly isn't working.
It's astonishing how politeness can often get better results than snideness. How a positive attitude can elicit the same. Do unto others, and all that.
I remember in my programming youth I would have killed for a site like CP. I'd hate to see people not using the site for fear of humiliation.
If I knew then what I know today, then I'd know the same now as I did then - then what would be the point?
.\\axxx
(That's an 'M')
|
|
|
|
|
Father Christmas wrote: I'd hate to see people not using the site for fear of humiliation.
Well said!!
|
|
|
|
|
Hi
I would like to change the output of my project that include exe,DLL and obj
I see that I can change the exe path at project->propoerties->build
How can I change also the obj outout such as *.csproj.GenerateResource.Cache,*.frmMain.resources, *.frmTemplate.resources
All the files above create at obj->debug and I wish to change it
Thanks
Ronen
|
|
|
|
|
In the csproj file, add a tag for BaseIntermediateOutputPath under root property group tag. Put the desired path there.
C isn't that hard: void (*(*f[])())() defines f as an array of unspecified size, of pointers to functions that return pointers to functions that return void
"Always program as if the person who will be maintaining your program is a violent psychopath that knows where you live." - Martin Golding
|
|
|
|
|
|
Hi, guys,
OK, my question might sound stupid, but I was googling around and didn't find anything about it
I was exploring an assembly using the Reflector tool, and I've came across several classes with weird names, say <module> or <privateimplementationdetails>{0DA2D479-FAFD-495A-B33D-A1B079722BAC}.
These do not belong to any namespaces defined in the assembly, so I have a feeling these are auto generated by the compiler.
So, the question basically is what are these classes for and how do I detect those type of classes in code. I guess, if I figure out what are they for, I'll find a way to detect them
Thanks
Regards,
Lev
|
|
|
|
|
My first thought would be these names are generated by an obfuscator
only two letters away from being an asset
|
|
|
|
|
No, Mark, I built this assembly (debug build) and I don't even have an obfuscator installed
So it's clean
Regards,
Lev
|
|
|
|
|
Hello everyone,
I've got a project and I am making a version 2 of this project. Though still version 1 must be active and used.
So I'm using preprocessor directives to assign the extra parts for the program for version 2. But in this case I have to place a #define VERSION_2 in every file where I want to make a difference between version 1 and version 2.
I would like to know if it is possible to put a #define in one file and use it in another file.
For example:
#define VERSION_2
namespace Prog.test
{
class test
{
#if VERSION_1
doThat();
#elif VERSION_2
doAnother();
#endif
}
}
namepace Prog.chair
{
class chair
{
#if VERSION_1 //does not work, because not defined
setHeight();
#elif VERSION_2 //does not work, because not defined
setWidth();
#endif
}
}
|
|
|
|
|
You can define them in the project properties:
Project -> (Name) Properties -> Build -> Conditional compilation symbols
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Thank you very much! That's all I needed
|
|
|
|
|
I would think the best way to accomplish backwards compatibility is to derive a new class from the original, and then the calling assembly can use whichever version it wants. No need for compiler directives at all.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|