|
We have a WPF forum. The control has a parent property, to know the type, you can use the GetType method, you can also use reflection. Any method that gets passed a control, sounds a little ugly to me.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
hi,
thnx for the reply..
The name is Sandeep
|
|
|
|
|
Hi
Because of various graphics that i use in my app, I want my app to run under Windows Classic Theme regardless of the theme the user has selected before they run my app.
Where can I find info about the API calls I need to swtich tmeme at start up and to restore to users' chosen theme on exit?
Thanks.
|
|
|
|
|
Swapping the whole system theme is a little user hostile. It would be better to skin your app to make it look the way you want.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
That's basically what I want to do, but using Windows Classic Theme for the skin instead of a custom skin, but didn't think of it that way.
Now all I have to do is find out how to do it - there are a lot of articles about skinning, so it is difficult to find the best article to look at.
|
|
|
|
|
Hi All
I'm working on a little web browser that supports tabs and all is good but everytime I click a link that is supposed to open in a new tab or window, instead of opening a new window/tab in my own web browser that i am making, it chooses to open a new instance of the system's default web browser (Internet Explorer) and I have tried to find some articles/samples on the web but have been unsuccessful.
Does anybody know how I would go about allowing links to be opened in a new tab in the browser i am making?
Any suggestions would be greatly appreciated
thanks
jason
|
|
|
|
|
Well, unless I misse the memo ( possible ), the web browser control doesn't support tabs. So, you'd have to catch the event of a page opening, swallow it, and create your own tab, and open the URL there.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
thanks christian, that's exactly what i'm trying to figure out, i obviously didn't explain my situation properly in my first message, sorry. I'll keep looking
|
|
|
|
|
http://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser_members.aspx[^]
Reading the MSDN, it looks like the NewWindow[^] event is what you want.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Thank you Christian for yout time and help, that link was very useful. I'm actually wondering how I could've overlooked that page in the first place.
Well, I am now browsing the web with full tab support yay! Thanks again christian. Maybe I could turn this into an article??
|
|
|
|
|
Well, if you finish the project, then I'd imagine you could write an article which covers this and other things you learned along the way. People are always writing their own browsers, so I'm sure it would be well recieved.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
I'm planning on adding a new type of favorites system, but also supporting existing favorites that have been created by other browsers, once that's finished I'll start writing the article. I'd love to see what others have to say about it.
|
|
|
|
|
hi,
zhe subject is that
class Class1 {
private string str = "class1.str";
private int i = 0;
static void StringConvert(string str) {
str = "string being converted.";
}
static void StringConvert(Class1 c) {
c.str = "string being converted.";
}
static void Add(int i) {
i++;
}
static void AddWithRef(ref int i) {
i++;
}
static void Main() {
int i1 = 10;
int i2 = 20;
string str = "str";
Class1 c = new Class1();
Add(i1);
AddWithRef(ref i2);
Add(c.i);
StringConvert(str);
StringConvert(c);
Console.WriteLine(i1);
Console.WriteLine(i2);
Console.WriteLine(c.i);
Console.WriteLine(str);
Console.WriteLine(c.str);
Console.Read();
}
tell me why "Console.WriteLine(str);" and "Console.WriteLine(c.str);"
zhe two sentence have two different results!
I know that zhe "string" is reference type!
but here i am puzzled!
modified on Saturday, June 20, 2009 8:09 AM
|
|
|
|
|
While you are correct that string is a reference type, you cannot change which string the local variable str in Main is referencing from the StringConvert function since you pass it by value. All you can do is make the parameter to StringConvert refer to another string, which will have no effect outside the function.
In the case where you passed a Class1, you are modifying the reference contained in the object referred to by the parameter, which is the same object referred to in Main. If you had put the line c = new Class1(); as the first line in StringConvert, it would no longer change the value in Main because the parameter in StringConvert would now be referring to a different object.
|
|
|
|
|
i want to send mail to yahoo mail automatically using c# code.
|
|
|
|
|
|
I want a Porche.....
Seriously, what have you tried ? Why do you have a specific issue with yahoo mail ? A quick google leads me to believe that a lot of people are asking this, so perhaps the issue is that yahoo does not support sending mail through a third party, or through the protocols that .NET supports.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Yahoo doesnt provide free smtp/pop3 service so you cannot use your Yahoo id to send mails from any other email client.
To use Yahoo mail you wil have to buy the Pop3 Service from yahoo.
Rishav Raj
http://hashtech.erishav.com
|
|
|
|
|
I have an application I made that simply gets the current directory using System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location goes up a directory level and then runs a file in that directory using System.Diagnostics.ProcessStartInfo and System.Diagnostics.Process.Start. The file works fine if I run it on my computer but if I put the file on a Shared Network Path I get the below error:
Unhandled Exception: System.Security.SecurityException: Request failed.
at System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Assembly a
sm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh, Secur
ityAction action, Object demand, IPermission permThatFailed)
at System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Object ass
emblyOrString, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle
rmh, SecurityAction action, Object demand, IPermission permThatFailed)
at System.Security.CodeAccessSecurityEngine.CheckSetHelper(PermissionSet gran
ts, PermissionSet refused, PermissionSet demands, RuntimeMethodHandle rmh, Objec
t assemblyOrString, SecurityAction action, Boolean throwException)
at System.Security.CodeAccessSecurityEngine.CheckSetHelper(CompressedStack cs
, PermissionSet grants, PermissionSet refused, PermissionSet demands, RuntimeMet
hodHandle rmh, Assembly asm, SecurityAction action)
at Setup.Program.Main(String[] args)
The action that failed was:
LinkDemand
The type of the first permission that failed was:
System.Security.PermissionSet
The demand was for:
<PermissionSet class="System.Security.PermissionSet"
version="1"
Unrestricted="true"/>
The granted set of the failing assembly was:
<PermissionSet class="System.Security.PermissionSet"
version="1">
<IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Read="USERNAME"/>
<IPermission class="System.Security.Permissions.FileDialogPermission, mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Unrestricted="true"/>
<IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Vers
ion=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Read="T:\ClientUpdate\"
PathDiscovery="T:\ClientUpdate\"/>
<IPermission class="System.Security.Permissions.IsolatedStorageFilePermission, m
scorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Allowed="AssemblyIsolationByUser"
UserQuota="9223372036854775807"
Expiry="9223372036854775807"
Permanent="True"/>
<IPermission class="System.Security.Permissions.ReflectionPermission, mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Flags="ReflectionEmit"/>
<IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Ve
rsion=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Flags="Assertion, Execution, BindingRedirects"/>
<IPermission class="System.Security.Permissions.UIPermission, mscorlib, Version=
2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Unrestricted="true"/>
<IPermission class="System.Security.Permissions.UrlIdentityPermission, mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Url="file:///T:/ClientUpdate/Setup.exe"/>
<IPermission class="System.Security.Permissions.ZoneIdentityPermission, mscorlib
, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Zone="Intranet"/>
<IPermission class="System.Net.DnsPermission, System, Version=2.0.0.0, Culture=n
eutral, PublicKeyToken=b77a5c561934e089"
version="1"
Unrestricted="true"/>
<IPermission class="System.Drawing.Printing.PrintingPermission, System.Drawing,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
version="1"
Level="DefaultPrinting"/>
</PermissionSet>
The assembly or AppDomain that failed was:
Setup, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
The Zone of the assembly that failed was:
Intranet
The Url of the assembly that failed was:
file:///T:/ClientUpdate/Setup.exe
Any ideas on how to fix this?
|
|
|
|
|
Obviously, if it can be fixed at all, then it requires you to set the right permissions on your intranet.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
We were actually looking for a way to fix this through code. We don't want to tell everyone that uses our software that they have to change there intranet settings just to run one file.
|
|
|
|
|
i need to make communication between computer to another machine. and this communication like two communication. first i need data from another machine(make sure it is not computer. i have to connect it with usb com port) and then also send acknowledge from computer to another machine.
i did with it serial communciation.but it was text. i need to receive float data and also sending same data. also i need to identyfying where the next string started and when it will finished.
help reply for this as early as
Arpita Patel
|
|
|
|
|
Hi,
The problem of mixing floats and text needs some kind of protocol. One can come up with several schemes, it depends on the kind of [ero[heral device (speed, memory, language), and the relative amount of floats versus text.
For your float data there basically are two ways to approach this:
1. use binary data, i.e. send bytes, not characters.
2. use strings to represent your float data; either apply ToString() when sending, and float.TryParse() when receiving (=more bytes, and some loss of precision); or get the bytes of a float, and turn them into a readable string, e.g. using base64 conversion (=4 ASCII char for 3 bytes of data) or hex (=2 ASCII char for 1 byte of data).
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
Perhaps XML serialization?
|
|
|
|
|
as the other device is "not a computer" I doubt XML is the way to go. Chances are the device has limited capabilities (limited CoreMark, few KBs of RAM, hardly an OS, C only, ...) and will dictate the way to go. we'll have to wait and see.
FWIW: Most of the time I avoided exchanging float data with small embedded systems; choosing an appropriate scale maps most physical stuff easily onto 16-bit integers.
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|