|
Hello,
here is a function's signatures for 2 PowerPoint effects event handlers:
SlideShowNextClick(SlideShowWindow Wn,Effect ef)
The effect onNextClick is ef.
SlideShowNextBuild(SlideShowWindow Wn)
What is a current executed effect??
At the moment I have next implementation:
1. By handle SlideShowNextClick store next effect name ("xyz").
2. By handle SlideShowNextBuild execute my bussiness logic (for effect "xyz").
The problem occurs if the current slide has more than 1 effect on page and "go back" button will be used. ==> I can't catch "goback"-event, thus I can't be sure that my stored "NextEffect" is a next effect realy.
Is it possible to get number/name of current executed effect directly in SlideShowNextBuild handler?
Many thanks for your help.
|
|
|
|
|
I have 35 labels on a picture, if i set these to transparent they just asume the color of the form.
Now after googling for a while i found out that i should use drawstring but then i cant move the objects anymore which is like the whole point of the application.
Move code: (with event trigger @ the end)
I have been trying to get this to work for about 16 hours im going out of my mind,
I'd would make me very happy if someone could assist me in creating a way to display the text ontop of a picture and still be able to move them.
Thanks allot!
ps exuse my crappy coding skill.
private void movepic(object sender, System.EventArgs e)
{
newcoord = 0;
math = 0;
decide = "";
input = input.ToLower();
startcoord = 0;
substract = false;
//c = center (320)
if (input.IndexOf("c") >= 0)
{
decide = "c";
}
//r = right (640)
if (input.IndexOf("r") >= 0)
{
decide = "r";
}
if (input.IndexOf("-") >= 0)
{
decide = "-";
}
if (input.IndexOf("c-") >= 0)
{
decide = "c-";
}
if (input.IndexOf("r-") >= 0)
{
decide = "r-";
}
switch(decide)
{
case "c":
startcoord = 320;
input = input.Remove(0,1);
break;
case "r":
startcoord = 640;
input = input.Remove(0,1);
break;
case "-":
substract = true;
input = input.Remove(0,1);
break;
case "c-":
startcoord = 320;
substract = true;
input = input.Remove(0,2);
break;
case "r-":
startcoord = 640;
substract = true;
input = input.Remove(0,2);
break;
default:
break;
}
if (input != "")
{
math = int.Parse(input);
}
if (input2 != "")
{
newcoord2 = int.Parse(input2);
}
if (substract == true)
{
newcoord = startcoord - math;
}
else
{
newcoord = startcoord + math;
}
labelselect.Location = new Point(newcoord,newcoord2);
labelselect.BringToFront();
}
private void element1(object sender, EventArgs e)
{
input = textBox1.Text;
input2 = textBox2.Text;
labelselect = label121;
movepic(sender, e);
}
|
|
|
|
|
Scalee wrote: I have 35 labels on a picture
WOW!
Scalee wrote: if i set these to transparent they just asume the color of the form.
Why don't you use
MyLabel.Visibility = false;
Scalee wrote: Now after googling for a while i found out that i should use drawstring but then i cant move the objects anymore which is like the whole point of the application.
Woosh! For what I know, you could make them Labels, and move them by handling mouse and/or keyboard events -eg. MouseUp, KeyUp, etc...-
Regards
|
|
|
|
|
mylabel.visibility is useless since they just disable the label and dont show the text at all.
And its about moving drawstring not labels.
Sorry if my didnt not cover that properly
|
|
|
|
|
I know you are talking about Text labels drawn by DrawString method, but why? I mean, my suggestion was to make them real Label Objects. Set their locations with your coordinates, and hide/show them if you need by using the Visible poperty.
Moving them would be much easier as each control would fire its event, and all you got to do is to handle these events, instead of drawing the text and then trying to get the mouse pointers coordinations to figure out which label was clicked to be moved.
Regards
|
|
|
|
|
the moving is working 100%, the problem is that the labels are overlapping each other thus giving a partial view.
I cant set there visibility to false then u would even see less then partials.
They all have to show at the same time, the problem is inside the font its self i believe.
i think theres some empty space above every icon thus leaving a black spot in the label (black picture background + black labels == near enough transparency) but now that black piece is overlapping the stuff above itsself.
|
|
|
|
|
OK! Now I see that I got you completely wrong the first time. Sorry for that. Can you upload a screenshot of what you suffer from, or explain more clearly?
1- You are suffering from the overlap of lables? Even if you did adjust the font type and size? Use a legend. You put only the label's number on the pictue, and the labels are numbered in a table outside the picture.
2- There are empty spaces around the text? Like a black background? That's quite odd?!!
Could you please post the code you are drawing the text with, o that's troubling you? I'm really interested in helping you.
Regards
|
|
|
|
|
Here's how I'd do it using drawString (it may not be the prettiest solution in the world, but never the less):
Keep a collection (an array, a list, whatever) of the strings that are being displayed, as well as the coordinates that they're kept at.
Then, in the onPaint method (I assume that's where you've been drawing the strings), make it run through that list every time drawing the strings at their repective coordinates.
Then I'd use the mouse event handlers for the picture, take the coordinates of the mouse pointer and find what string is underneath the pointer. (This might take a bit to get right - you'll have to find some way of determining the length of a string in pixels). Then just update the string's coordinates in the collection.
P.S. Sorry if I mis-understood the problem, or if my solution sucked.
|
|
|
|
|
|
Woopsie
Thanks.
|
|
|
|
|
Here's how I'd do it using drawString (it may not be the prettiest solution in the world, but never the less):
Keep a collection (an array, a list, whatever) of the strings that are being displayed, as well as the coordinates that they're kept at.
Then, in the onPaint method (I assume that's where you've been drawing the strings), make it run through that list every time drawing the strings at their repective coordinates.
Then I'd use the mouse event handlers for the picture, take the coordinates of the mouse pointer and find what string is underneath the pointer. (This might take a bit to get right - you'll have to find some way of determining the length of a string in pixels). Then just update the string's coordinates in the collection.
P.S. Sorry if I mis-understood the problem, or if my solution sucked.
|
|
|
|
|
hi,
i want to know if the "ENTER" key is pressed or the "Escape" key, to make some acion. This should take place when the cursor is inside a text box.
Best regards.
***LET THE BEST MAN WINS***
|
|
|
|
|
Take a look at the TextBox.KeyDown , TextBox.KeyPress and TextBox.KeyUp events
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
I tried using those events button i didn't know how to write a condition to know if the "ENTER" or "ESCAPE" buttons are pressed.
Best regards
|
|
|
|
|
You have to evaluate the xxEventArgs object that is passed into the event handler.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Use TextBox.KeyDown event where you will get KeyeventArgs.
You can compare e.key ot keys enumeration.
|
|
|
|
|
I also tried this but it is not working
it is making me go mad.
thanks
|
|
|
|
|
In key down event
if (e.KeyCode == Keys.Enter)
MessageBox.Show("KeyDown : Enter Pressed");
In key press event
if (e.KeyCode == (char)Keys.Enter)
MessageBox.Show("KeyPress : Enter Pressed");
This should perfectly work.
If not at ur end, pls show ur code..
|
|
|
|
|
this is the same code that i tried and it did't work
it is ok.
i will see what i can do.
Can it be not working because i set the AcceptAction property of the frame to a certaing button?
this could be it.
i will try it.
thanks
|
|
|
|
|
ok i found it.
The problem was the one i described in the earlier post.
it is that i set the acceptButton property to a certain button of the frame
that disabled the keyDown event to know when the Enter is pressed
thanks for your replies
best regards
|
|
|
|
|
Hi,
I need to write an application that logs when a user opens/runs or activates an application in C#. Any Windows API that can handle that?
Thanks
Eka
|
|
|
|
|
I'm not sure how you would check when an applications gets focus or whatever, but you can create an array and store in it each process that is running, then check it against currently running process in a few seconds and update it, and repeat.
That would give you a log of what processes are being run. You can also probably get the window title as well.
|
|
|
|
|
Yes there is. In windows system there is something called WinEvents . Pretty much like C# events. These are system messages sent to whomever is interested in receiving them. You declare yourself interested in receiving a certain message by registering a hook to that message -aka WinEvent-.
Anyway. Here is the sum up:
Event to hook: EVENT_SYSTEM_FOREGROUND . Click here for more events[^].
Hook function: SetWinEventHook()
Click here for an example[^]
Regards
|
|
|
|
|
Having solved the original problem I have now run into more threading problems. When i fire an event in my bindable list i get the dreaded "cross-threaded operation..." error. No problem i thought, i'll cast the target to control and invoke against that, that'll work. I then discover that the target is of type CurrencyManager and does not have an invoke method.
How can i raise an event back to the currency manager on the thread that the control it is managing was created on?
Thanks Russell.
My early morning sleepy post is below
------------------------------------------------------------------------------------------------
Hi guys,
I've got a datagridview in my application which is bound to an IBindableList which i have built to implement sorting filtering etc. I've mad some changes to the events within my app to make sure that the background threads execute in the right order and now i only have blank rows in my grid. When i select a filter criteria the right number of lines are displayed in the grid but they are all empty. I've inspected the underlying collection and the data are all correct. The grid i requesting the objects from the collection when i would expect it to. I've placed breakpoints in the property get code and it seems that the grid is not requesting any data.
I would greatly appreciate any help you can give.
Thanks
Russell
-- modified at 8:50 Monday 4th December, 2006
|
|
|
|
|
Managed to answer my own question as i closed the browser.
I had moved the line of code from the form constructor into an eventhandler. I've now made it invoke the code that sets the datasource and it's looking good.
Russ
|
|
|
|