|
Set the Icon property of your form - that alters the runtime icon shown in the control box at the top left, and the taskbar.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
I wanna the exe icon change!!
|
|
|
|
|
You cannot, it is technically not possible.
What you are seeing is a "link" to that file, and yes, that can have its own icon.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
|
Perhaps other readers might be wondering "what error"
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
That's nice and all, but you can NOT change the icon of your .EXE while it's running. The file is locked by the system until the .EXE quits. You have to change it from another executable in order for this to work.
|
|
|
|
|
You have been here four years - that's long enough for you to know that you need to tell us what you want because we can't see your screen, access your HDD, or read your mind. So explain: which icon do you want to change at run time (there are several places your app icon can appear)? Where? When? And probably most important, why?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
hi!
I'm trying to rotate a simple point over another one, here is the code:
x = (x - x1) * (Math.Cos(1)) - (y - y1) * Math.Sin(1) + x1;
y =(x - x1)*(Math.Sin(1)) + (y - y1)*Math.Cos(1) + y1;
Point1.Location = new Point((int)x,(int)y);
but it's seem that the rotation go like a shell of snail to direction of the origin(x1,y1) and then stops;
maybe I should round the double x and y and convert them to int, because when converting directly, I'm just close that make the number degrade is that the problem?
|
|
|
|
|
You should store the points coordinates in doubles, calculate everything in doubles and only convert to integer for displaying (and don't feed these integers back into the calculation). For even more accuracy (if needed) you could, instead of incrementally changing the points coordinates, calculate the to-display-coordinates always from the points origin by incrementing the rotation angle.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
Thanks man, you saved my life, all the day of hopeless , I feel a king now
|
|
|
|
|
Hehe You're welcome!
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
My XML data :
<xml>
<item>
<locationId>1</locationId>
<state></state>
<location>ABCD</location>
</item>
<item>
<locationId>2</locationId>
<state></state>
<location>EFGH</location>
</item>
</xml>
I need to parse this and retrieve the value of "locationId" and "location" alone.
Thanks in Advance.
|
|
|
|
|
See the System.Xml namespace.
|
|
|
|
|
Hi Guys,
Im having some trouble with JSON.
I need to retrieve the email value of each of a list of contacts, but am unable to do so.
string json = @"
{
'contacts': [
{
'vid': 154835,
'properties': {
'firstname': {
'value': 'HubSpot'
},
'lastname': {
'value': 'Test'
}
},
'identity-profiles': [
{
'vid': 154835,
'saved-at-timestamp': 1405347851237,
'deleted-changed-timestamp': 0,
'identities': [
{
'type': 'EMAIL',
'value': 'test@hubspot.com',
'timestamp': 1405347851180
},
{
'type': 'LEAD_GUID',
'value': 'c8f20860-d3d6-4b57-b092-86a07cebdcbc',
'timestamp': 1405347851237
}
]
}
],
'merge-audits': []
}
],
'has-more': true,
'vid-offset': 196189
}";
Above is one contact from a list of contacts.
Below is the code Im using to retrieve the required data.
Im able to retrieve firstname and lastname, but am unable to retrieve email.
Any suggestions as to how I can go about retrieving the email value?
dynamic data = JObject.Parse(strReader);
var vContacts = from i in (IEnumerable<dynamic>)data.contacts
select new
{
vid = i.vid,
firstname = i.properties.firstname.value,
lastname = i.properties.lastname.value,
email = (string)i.SelectToken("identity-profiles.identities.value")
};
Any help would be appreciated.
|
|
|
|
|
Please try this:
email = (string)i.SelectToken("identity-profiles[0].identities[0].value")
identity-profiles and identities are arrays, so you have to specify the index of the desired item.
See: http://www.newtonsoft.com/json/help/html/SelectToken.htm[^]
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
Thats the second time in as many days that you've helped.
Sascha, thanks a lot, that worked.
dynamic data = JObject.Parse(strReader);
var vContacts = from i in (IEnumerable<dynamic>)data.contacts
select new
{
vid = i.vid,
firstname = i.properties.firstname.value,
lastname = i.properties.lastname.value,
email = i["identity-profiles"][0]["identities"][0]["value"]
};
|
|
|
|
|
You're welcome, glad I could help
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
Psst you can up vote his answer with the little red GREEN arrow that appears on the left of the reply, that way his rep is enhanced.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Ah, I wasn't aware, thanks for letting me know.
|
|
|
|
|
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
So I have a web application for a time log management system. I have it to where you can create a timelog if you are an employee for the hours you have previously worked. I cannot figure out how to enable employees from entering in future work hours on the timelog entry and need some help please!
|
|
|
|
|
Member 11620437 wrote: I cannot figure out how to You need to provide technical details. How are we supposed to figure it out when knowing nothing about it beyond it's intended purpose?
- Put yourself in the shoes of someone trying to answer this. Can you really imagine anyone can? What are you expecting the answer to this could be?
- How does it not work? What did you do? What were you expecting, and what happened instead?
- Ask yourself: is there enough information for anybody who’s not you to figure out what the problem is?
- Notice how asking a question that is too vague will only get you more questions in return.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
modified 19-Apr-15 18:45pm.
|
|
|
|
|
Hi,
How can I add 3 objects to an array in C# ? I created 3 objects of a class and I want those three objects in an array in another class but I get the syntax wrong.
here in the main method I created 3 objects from Class student
static void Main(string[] args)
{
Student student1 = new Student
{
FirstName = "John",
LastName = "Wayne",
BirthDate = "26/05/1907"
};
Student student2 = new Student
{
FirstName = "Craig",
LastName = "Playstead",
BirthDate ="01/01/1967"
};
Student student3 = new Student
{
FirstName = "Paula",
LastName = "Smith",
BirthDate = "01/12/1977"
};
In another class I want to create an array and put the 3 student objects into it, how do I do that ? So far I only created an array[3]
Public class Course
{
private string courseName;
public string CourseName
{
get { return courseName; }
set { courseName = value; }
}
Student[] studentarray = new Student[3];
modified 19-Apr-15 14:35pm.
|
|
|
|
|
Very easy:
Student[] studentarray = new Student[3];
studentarray[0] = student1;
studentarray[1] = student2;
studentarray[2] = student3;
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
thanks, i got the syntax mixed up !
**edit., i get lots of errors when I try this
Error 1 Array size cannot be specified in a variable declaration (try initializing with a 'new' expression)
|
|
|
|