|
hello !
i making a remote support app and i trying to get the screen image when the computer is in lock mode or in log off mode and i can't.. i only get a black screen !!! can somebody help me ?
thx
|
|
|
|
|
Think about what state the system will be in if it is locked or if no user is logged on.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
You're getting a black screen because the image you're capturing is on a Desktop that is no longer visible. When the workstation is locked, the user see a different Desktop. Whatever you're using to capture the screen isn't written to handle multiple Desktops.
|
|
|
|
|
public static System.Windows.Forms.Control FindControl(string id, System.Windows.Forms.Form.ControlCollection col)
{
System.Windows.Forms.Control child = null;
foreach (System.Windows.Forms.Control c in col)
{
if (c.GetType().Name.ToUpper() == "TOOLSTRIP")
{
foreach (System.Windows.Forms.ToolStripItem item in ((System.Windows.Forms.ToolStrip)c).Items)
{
switch (item.GetType().Name)
{
case "ToolStripButton":
child = ((Control)((ToolStripButton)item));
break;
case "ToolStripComboBox":
break;
case "ToolStripLabel":
break;
case "ToolStripMenuItem":
break;
case "ToolStripProgressBar":
break;
case "ToolStripStatusLabel":
break;
case "ToolStripTextBox":
break;
}
}
}
else
{
child = FindControlRecursive(c, id);
}
if (child != null)
return child;
}
return null;
}
tbhattacharjee
|
|
|
|
|
Format your code using the pre tags, i.e. use the "code block" menu item.
Ask a question, the subject is not the question
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Tridip,
Some user interface elements are not controls, e.g. TreeNode, ToolTip and all of the classes derived from ToolStripItem. If you look at the base types for Button and ToolStripButton in the object browser you'll see
Button -> ButtonBase -> Control -> Component
ToolStripButton -> ToolStripItem -> Component
The consequence of this inheritance hierarchy is that a form's control collection does not contain the ToolStripItems and a ToolStripItem cannot be cast to a Control.
Alan.
|
|
|
|
|
hi!
in windows application, i am using datagridview in a form to display the records from the database.
my query is that, when i select the checkbox and click edit button of any record from the datagridview the related value of the selected checkbox appear on the textbox of second form.
please guide me on this.
thanx with regards
|
|
|
|
|
I might misinterpret your question, but if you want to know how to pass a value from Form1 to Form2 (that value being the selected value of a cell in datagrid), just read the value and send it as a parameter to the constructor of Form2 and set the Text property of the textbox (of Form2) to the parameter value.
|
|
|
|
|
Hi guys,
I have a huge problem and I have no idea how to fix it. I have two different web services - one we'll call LibrarySearch and one we'll call LibrarySorter. These are two different projects. Both have a class called Book and it's the same exact class.
But when I call each of them they return as LibrarySearch.Book and LibrarySorter.Book ... and I have no way of converting these to some generic item which I can use (without having to create two objects, one for each result depending on whether the user did a search or a sort).
Please help. I even tried to serialize to a stream, and de-serialize back and it still didn't work.
Thank you for your time.
In life truth does not matter. What really matters is what others believe to be the truth. (The Up and Comer - Book)
|
|
|
|
|
Web services are not OO friendly, in fact outlining why is a classic interview question. The Book class in the LibraySorter is not the same type as the Book class in the LibrarySearch as far as the proxies are concerned (even if the services use a common class from a dll for example). The generated proxy classes generated have different namespaces for one thing.
One solution is to take the pain:
Client model<--->client/proxy translator<--->proxy classes<--->service <--->service OM translator<--->OM
The translators aren't too bad, normally.
[Edit fixed spelling, also, see Pete's reply]
|
|
|
|
|
The problem is, as far as your code is concerned - these are two separate and discrete objects with no commonality, so you can't cast between them. This is because they are from two separate discrete sources - this is to do with the way that items are created when you import their definitions in - each reference has it's own physical implementation of the class.
|
|
|
|
|
If you can change them both, then the best thing to do is to set up a separate assembly (LibraryUtilities or similar) which contains your Book class. Both services then refer to that.
Other than that, it's a case of manual conversion if you want to be safe - i.e. create a new LibrarySearch.Book from your instance of a LibrarySorter.Book and vice versa. They are treated as different classes because one of them could be changed without the other altering. Just casting (or serialize / deserialise) won't work because the compiler can't know they are the same: it sees the names are different and knows they could be different in the future.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
What I ended up doing is serializing from one type to a file, then de-serializing that file to the other type.
Messy, but worked.
I'll try to see if I can serialize to a memory stream instead.
In life truth does not matter. What really matters is what others believe to be the truth. (The Up and Comer - Book)
|
|
|
|
|
|
i dont know how to add into php a text, help me, thanks !
|
|
|
|
|
Please post a specific question in the correct forum (in this case the PHP Forum). Your question doesn't really give any information about the problem, so if you re-post this there you'll won't get any helpful responses.
|
|
|
|
|
As Keith said, this is the C#-forum, if you want help in PHP, then post in the correct forum.
And what do you mean, "add into php a text"? Add a text into a database, show some text on the screen, add a comment-text into your PHP-code...? Your question is not clear at all.
And don't use bold text for your question.
edit: Your question's topic says "how to compose a content with PHP", therefore I assume you want to know, how to display text on the screen:
echo "your text";
"I love deadlines. I like the whooshing sound they make as they fly by." (DNA)
|
|
|
|
|
Hi,
In my C#/Winforms application, I want to define a string containing a subscript like the 2 in H2O. I tried to type H2O into Word and then copy it to the string resources, but the text changes to H2O (no subscript). The same thing happens when I paste it into C# code.
Does anybody know how to enter a subscript? I wouldn't mind using a string literal in C# code but ideally, I want to define this as a string resource.
I'm using Visual Studio 2008.
Martijn
|
|
|
|
|
I don't think there is a choice in the matter unless there is a Unicode subscript for 2 (or whatever number you want) like: U+2082 so "\u2082" may work.
|
|
|
|
|
Thanks! Yeah, something like "H\u2082O" as a C# literal gives the right result. H20 is the only thing I need right now, so I'll be OK.
Typing "H\u2082O" as string resource does not work. I guess there is some other kind of escape sequence for including a unicode character.
After reading up a bit more on the subject, it becomes clear why copy & paste does not work. Unicode does not implement subscripts and superscripts as markup, while HTML, RTF, MathML and probably Word do. Unicode only has a small set of subscript and superscript characters, so there is no easy translation between marked up text and unicode characters. So, in order to fully support subscript and superscript in resource files, we cannot use pure Unicode but rather have to use some form of markup like RTF or HTML.
|
|
|
|
|
There is no such thing as style, size, color, ... in a regular string, as a string is just a sequence of characters, without any style, size, color... attached to them. So if you want some formatting, it will have to be tailored to and handled by the target.
I can think of three ways to render a text with some non-homogeneous style attributes:
1. use the special characters in the font; this only works in limited cases, however it may suit your needs as there are some subscript and superscript digits in most fonts, and they have Unicode numbers.
2. use a Control that knows how to handle partial formatting; BTW that is what you did in your question, by using <sub> tags. A WebBrowser control knows how to handle them; a RichTextBox would deal with RTF commands; etc.
3. paint it yourself, using the Graphics class (assuming you're rendering to a Windows Form).
|
|
|
|
|
Thanks for your elaborate reply. I slowly came to that conclusion myself before reading your post! See my reply to the reply by Ennis.
Cheers,
Martijn
|
|
|
|
|
I want to challenge you on your hint that subscript and superscript are considered style. Why would unicode include some subscript/superscript characters when it's considered 'style'?
Subscript and superscript are on the border of formatting and contents, much like capitalization, which is a part of Unicode. cm2 and cm2 are 2 different things (or rather, cm2 is incorrect).
On http://www.w3.org/TR/unicode-xml/#Superscripts it says:
"For super or subscripted letters in phonetic transcription in particular, a change from superscript of subscript to regular style would alter the meaning. Note that such use in transcription is not limited to letters: superscripted small digits are often used to indicate tone."
So, in the phonetic presentation of text, w3c argues that tone is content and not formatting. I would actually think the opposite: tone is presentation and it would make more sense to use markup. For example, different dialects of a language may have different intonations while the contents remains the same.
How about text. By using the 'em' HTML tag, a specific part of a sentence will be highlighted or bolded and it may change the meaning of a sentence. Is this contents or formatting?
Here is one thing that I'm sure of: W3C, Unicode, OMG and whoever works in these groups are people who sometimes make decisions for the sake of practicality (although they'd like to give the impression that everything they do makes 100% sense). It would be very impractical to not be able to make the distinction between cm2 and cm2 in plain text. They also found it more practical in their phonetic presentation of text.
At the same rate, it is more practical to represent color, fonts, etc in markup than it is in Unicode characters.
|
|
|
|
|
Martijn Boeker wrote: Why would unicode include some subscript/superscript characters when it's considered 'style'?
If you find super- and sub-script numbers in the font you're using, you can use those characters in your string. Those are not styles.
Luc is correct, there is no such thing as style in a String object.
|
|
|
|
|
I know Luc is correct and it was nice of him to give an elaborate reply. However, I found his answer a bit condescending, because it's obvious that color is style and not part of plain text, whereas subscript/superscript is in a bit of a different class (sometimes it's a character, sometimes it's style). Anyway, I should just be happy with his answer, which was helpful, and let my ego go 
|
|
|
|