|
MasterSharp wrote: Does anyone know places where I can learn more about visuals for C#, like, blurring, softening and things like that?
That depends on if you are talking about graphics, windows forms or WPF.
MasterSharp wrote: is there a way to set events for graphics you've drawn, like click and hold?
Graphics that you have drawn are just differently coloured pixels, they can't handle events. If you want evens, you need controls.
---
"Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things."
-- Douglas Adams
|
|
|
|
|
Ah... I mean graphics. Well, I had an idea where you could grab a circle by clicking and holding and move it, and release the click to drop it... It's for another simple game I thought I could achieve...
The most knowledge doesn't mean the most wise...
|
|
|
|
|
Here's [^] about as simple an example as I can find.
|
|
|
|
|
Hey, I'll take anything. Thanks a lot!
The most knowledge doesn't mean the most wise...
|
|
|
|
|
Also, is there any way to make lines in an app anti-aliased?
The most knowledge doesn't mean the most wise...
|
|
|
|
|
MasterSharp wrote: Also, is there any way to make lines in an app anti-aliased?
Yes. If you are drawing in a graphics container, you can set the SmoothingMode to AntiAlias. This will not affect the text, but will affect lines in the container. Check out the MSDN documentation for Graphics.SmoothingMode.
Marshall
If you continue to do the same things you always did, don't be surprised if you get the same results you always got.
|
|
|
|
|
Where is smoothingmode? Is it an extra using statement? Also, do you know the code to, while the mouse is clicked over a picturebox, that you can drag it around? I checked out the drag and drop events, but I don't see... Thanks, tough.
The most knowledge doesn't mean the most wise...
|
|
|
|
|
I found smoothingmode. Thanks, but can you still help with the other thing?
The most knowledge doesn't mean the most wise...
|
|
|
|
|
Can I use more than one of the coices in smoothingmode at once?
The most knowledge doesn't mean the most wise...
|
|
|
|
|
No you can't use more than one choice.
Marshall
If you continue to do the same things you always did, don't be surprised if you get the same results you always got.
|
|
|
|
|
Do you know anything about the dragging thing?
The most knowledge doesn't mean the most wise...
|
|
|
|
|
Pardon me for saying so, but it sounds to me like you are in way over your head. You are simply writing code without any understanding of what it means. I suggest you slow down, read and understand the documentation. Then think about how each object works and how you can manipulate it to accomplish your goal. If you do that, you will quickly see the answer to your question. Getting fast answers on the web is not going to help you in the long run.
I am not trying to insult you and hope you see that. I am only trying to give you good advice.
Marshall
If you continue to do the same things you always did, don't be surprised if you get the same results you always got.
|
|
|
|
|
Yes, I understand, and I know a bit more than how I seem, though I'm undoubtably a beginner.THat was a stupid question if I could use more than one...
The most knowledge doesn't mean the most wise...
|
|
|
|
|
hi all,
I have customized listview to display images in thumbnail view as in windows explorer.
I have set ownerdraw property as true and used the drawitem event of listview to redraw the listview.
Now when i click any item in the listview, the selectedindexchange event is fired twice.
Why is the event firing twice? What could be the problem?
Any suggestions please.
Thanks in advance.
Regards
Anuradha
|
|
|
|
|
Without any code it's really impossible to tell. But chances are it's not related to your custom draw code. I would guess that it's related to your code that hooks up the SelectedIndexChanged event. Unless you explicitly firing that event in your custom ListView control.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
Hi, some Controls with selection capabilities fire twice: once when they unselect the
existing selection, and again when they apply the new selection. Check the EventArgs
to get the details, and you will know whether it is this phenomenon, rather than
the exactly same event firing twice.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
hi,
I have found one solution which seems to be working fine. but still i would like to have a better and liable solution. in the selectedindexchange event i wrote the following code.
private void listView1_SelectedIndexChanged(object sender, EventArgs e)
{
if (listView1.SelectedItems.Count > 0)
MessageBox.Show("Clicked");
}
is this solution right?
Thanks in advance.
Regards
Anuradha
|
|
|
|
|
I've made my app to minimize in tray. When a user is trying to open another app , I want to show the running instance from tray.
I tried to do that by using ShowWindow function, but I didn't succeeded. When my app is not in tray (for example, is behind another window), when I try to open another instance , the main window is shown, as I want.
What ca I do, to make the same thing when is in tray.
-- modified at 10:16 Friday 19th October, 2007
|
|
|
|
|
I've used this[^] in an application to handle the single instance stuff, and it works really nicely
You'll probably need to do something like this to pop your window back to life:
Show()
WindowState = FormWindowState.Normal;
TopMost = true;
BringToFront();
TopMost = false;
I'm not sure why, but BringToFront() on its own sometimes doesn't do the trick. I don't know if Windows is trying to prevent the window stealing focus from you, or something.
|
|
|
|
|
I am doing the following:
When application start running , I'm verifying if another instance is running. If there is another instance I'm showing it. But if is in tray, I can't show it. When I put my app in tray I hide it.
I've thought doing what you've said but I can't get the object to manipulate the window, when I need to, or i don't know how.
-- modified at 10:39 Friday 19th October, 2007
|
|
|
|
|
The singleton stuff in that article takes care of communicating with the existing instance - see the
OnAppStartupNextInstance bit - that's where your old window gets re-activated
|
|
|
|
|
Ok, I got it .
Thank you for helping me!
|
|
|
|
|
benjymous wrote: BringToFront()
Scary, because that function controls z-order....
xacc.ide
The rule of three: "The first time you notice something that might repeat, don't generalize it. The second time the situation occurs, develop in a similar fashion -- possibly even copy/paste -- but don't generalize yet. On the third time, look to generalize the approach."
|
|
|
|
|
I have a number of FxCop rule assemblies. I need to get all the names of the rules in these assemblies, and as far as I understand i could do this by using reflection on the assembly and getting the XML files.
So my question is: Is it possible, and if so, how do I retrieve an embedded XML file from an assembly?
fafafa, ringakta icke sådant som bringa ack så naggande högönsklig välmåga å baronens ära.
|
|
|
|
|
nvm i solved my own problem ^^
foreach (string str in ASSEMBLY.GetManifestResourceNames())
{
using (StreamReader SR = new StreamReader(ASSEMBLY.GetManifestResourceStream(str)))
{
Console.WriteLine(SR.ReadToEnd());
}
}
fafafa, ringakta icke sådant som bringa ack så naggande högönsklig välmåga å baronens ära.
|
|
|
|