|
I think that's not possible.
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
Convert.ToInt32 Method or Convert.ToInt64 Method or Convert.ToInt16
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
What about Int32.Parse("23");?? exactly the same??
|
|
|
|
|
for any conversation i use System.Convert.
Example:
string str = "555";
int i = System.Convert.ToInt32(str);
(also you can use ToInt16(), ToInt64() ...)
See System.Convert for additional Information.
Rgrds
Martin
|
|
|
|
|
If you left click on a line item in a listbox it selects the item. Clicking the right mouse button is detectable in the listbox but does not select the item. Is there a way to override this listbox behaviour and select an item with the right mouse button?
Kyle
|
|
|
|
|
override the MouseDown Event from the ListBox Control:
private void listBox_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
if(e.Button != MouseButtons.Right) return;
int nIndex = listBox.IndexFromPoint(new Point(e.X,e.Y));
if(nIndex != -1)
listBox.SetSelected(nIndex,true);
}
Rgrds
Martin
|
|
|
|
|
I'm creating a program that will pull information from a SQL database and map those fields onto a Word Document.
The Word Document is formatted with bookmarks so you can easily reference to the part of the document you wish to append to.
I know this is possible in VB and Delphi 6; however, I've found nothing in C#.
Has anyone experimented with this? Or do you know where I might go to find some more information?
Thanks guys,
-Chris Bryant
|
|
|
|
|
Hi All,
I am trying to find out if we can connect a C# Application to a website and view some details as in, how many sessions are open and what there SessionID's are.
Things like that.
Would this be possible?
Thanks
|
|
|
|
|
I have a DLL, this export some functions and one of them starts a new thread.
from this thread my Program recieve some userdefined messages. in C++ everything ist OK, but I have to supply the functionality of this DLL for a C# App.
And I don't know how to catch the messages from the thread....
If I look with Spy++ to the Form, it recive them, but I have no idea how to handle them....
|
|
|
|
|
To get the messages you can override the WndProc method on your Control/UserControl/Form.
protected override void WndProc( ref Message m ) {
switch(m.Msg) {
case MY_CUSTOM_MSG:
break;
default:
base.WndProc(m);
break;
}
} That should be the basic look of it.
HTH,
James
Sonork ID: 100.11138 - Hasaki
"Smile your little smile, take some tea with me awhile.
And every day we'll turn another page.
Behind our glass we'll sit and look at our ever-open book,
One brown mouse sitting in a cage."
"One Brown Mouse" from Heavy Horses, Jethro Tull 1978
|
|
|
|
|
thank you!! now i get the messages.
|
|
|
|
|
Hi guys, simple question, how do you use resource files in C#? For example, suppose I create an icon using the editor in VS .NET and the file is named icon1.ico, how would I the go about referencing that file from my code? Currently I keep getting file not found errors (during debugging) because it seems the system checks for the file in the bin directory (I think). Also, what is the best way to set up a repository of resources for my project? For example, if I have alot of different icons that I would like to use dynamically in my app, how would I set that up?
Regards, Senkwe
Just another wannabe code junky
|
|
|
|
|
Senkwe Chanda wrote:
Hi guys, simple question, how do you use resource files in C#? For example, suppose I create an icon using the editor in VS .NET and the file is named icon1.ico, how would I the go about referencing that file from my code?
In VS.NET click on your icon in the Solution Explorer then in the properties box change the Build Action to "Embedded Resource".
Now when you build your project you can get a stream to the file from the assembly.
System.Reflection.Assembly asm = GetType().Assembly;
System.IO.Stream = asm.GetManifestResourceStream("myDefaultNamespace.myFolder.Icon1.ico")); The string that is passed in is a tad difficult to understand at first.
myDefaultNamespace is the namespace that is assigned by default to new classes that are added to your project. You can see what this is by going into the properties for your project.
If you create a folder within your project and place icons in there, then you also append the folder names to the namespace (if you haven't noticed it -- when you create a folder, any classes created inside that folder have the folder name appended to the default namespace); finally append the filename.
In the example above i have an icon named Icon1.ico located in a folder called myFolder in my project with a default namespace of myDefaultNamespace.
It is possible to set the default namespace to nothing, in which case you use the folder (if any) and the filename.
HTH,
James
Sonork ID: 100.11138 - Hasaki
"My words but a whisper -- your deafness a SHOUT.
I may make you feel but I can't make you think." - Thick as a Brick, Jethro Tull 1972
|
|
|
|
|
Hi,
I need to know how to open a new browser after i had consume a web service...please help me....
|
|
|
|
|
Is it possible to lock the first column in the datagrid control (Windows Forms version) so that it can never scroll off the viewable area? Similar to the way Excels 'freeze panes' feature works.
|
|
|
|
|
Hi
I have a new class witch I want to make "public" for the .NET framework, I have tried to use the "gacutil", but when I try to compile a new calls file using my "namespace" it fails.
Thanks
|
|
|
|
|
To use an assembly that is in the GAC you still must reference the assembly. What seems to be a pain is that you can't just reference it and let it find it in the GAC you have to specifically tell it where to look for your assembly.
What I did was I made a copy of my assembly and placed it in the same directory as my source, I then added a reference to that (using VS.NET or the /r: compiler switch). Once the code is compiled (and the assembly is in the GAC) you no longer need the local copy of the assembly.
Now when you run your code, if the assembly isn't located in the current directory it will search the GAC for it.
HTH,
James
Sonork ID: 100.11138 - Hasaki
"My words but a whisper -- your deafness a SHOUT.
I may make you feel but I can't make you think." - Thick as a Brick, Jethro Tull 1972
|
|
|
|
|
Hi James,
And THX (again)
It works great But let's say I want to be able to add the "reference" from the GAC with VS. Even though I have added the DLL to GAC, the listbox don't have my DLL?
My question is really how do I re-distribute my application without changing to much - it would be great if xcopy and maybe GACUtil was the only task.
If I copy my DLL to the webapp's BIN folder, and add the Reference it displays a full path(URL), and If I copy the webapplication to another URL - it would fail right?
Thanks
Felix
|
|
|
|
|
Felix Nielsen wrote:
But let's say I want to be able to add the "reference" from the GAC with VS. Even though I have added the DLL to GAC, the listbox don't have my DLL?
It seems odd, but VS.NET doesn't show assemblies that are in the GAC. Instead it shows assemblies from a few pre-defined locations. The best place to put such an assembly would be $windows_dir\Microsoft.NET\Framework\$dotnet_version\
Then VS.NET will see your assembly and add it to the list.
Now the question you need to ask yourself is "What about my assembly warrants making it available to everyone?" 9 times out of 10 there isn't really any reason to put something in the GAC. The GAC should be used for assemblies that other people/companies will want to use in their products where the size of the assembly is large enough to warrant not keeping a local version.
Felix Nielsen wrote:
If I copy my DLL to the webapp's BIN folder, and add the Reference it displays a full path(URL), and If I copy the webapplication to another URL - it would fail right?
Nope, VS.NET references everything relative to the project directory. So if you place an assembly in your bin directory the project file stores it as "bin\myAssembly.dll". If it can't find it there, it will begin a search to find it in other locations too. I don't recall what those locations are off the top of my head though.
HTH,
James
Sonork ID: 100.11138 - Hasaki
"My words but a whisper -- your deafness a SHOUT.
I may make you feel but I can't make you think." - Thick as a Brick, Jethro Tull 1972
|
|
|
|
|
I'm creating a registry editor exaclty like RegEdit and I want to know how Can I retrieve Value who have DWORD and Binary type to put it in a ListView
I use Convert.ToString(...) but if I got a binary or DWORD value i got System.Byte[] or System.String[];
How can I fix this ?
|
|
|
|
|
Hello,
My name is Aaron Thompson. I am a student at Columbus State Community College in Columbus Ohio. I am currently seeking an AAS of Computer Programming Technology, but I have just started into the world of programming, so my experience is very limited. I am currently working on a report about C#, and needed to get some primary research data. I have done a good deal of research into what C# is about, but I am still very much the novice. The report is for my Business English class, and does not have to be overly technical. I have a few questions that I have come up with, and any responses would be greatly appreciated. If possible could I have responses by Friday March 1st? If you would like to send your response to my hotmail account, it is aroconthom@hotmail.com.
If you could also leave your name and an email address for reference information that would be great. If you would not like to be referenced, your response is still very much welcomed. Thank you in advance for any help I receive.
1) What features of C# do you find to be the most useful to you when writing programs? Please list 3-5 features for your answer.
A few examples of what I would consider features of C#: The garbge collection mechanism, access to the .NET libraries for easier inheitance of code, and the ability to manage memory yourself by declaring a section of code as "unsafe".
2) What features would you consider to be the least useful to you when writting programs in C#? Please list 1-3 for your answer.
3) What previous programming languages experince do you find the most helpful when learning to use C#?
Such as profficiency with Visual Basic, C, C++, JAVA, etc.
|
|
|
|
|
Aaron T. wrote:
What features would you consider to be the least useful to you when writting programs in C#? Please list 1-3 for your answer.
Managed code/garbage collection...
No direct and easy access to the Windows API
No "real" pointers
I can't compile native applications
Aaron T. wrote:
What previous programming languages experince do you find the most helpful when learning to use C#?
Such as profficiency with Visual Basic, C, C++, JAVA, etc.
I have programming C++ for a looong time, and some years ago I also programmed in Delphi, both have been very usefull when trying out C#.
(Delphi and C# is both designed by Anders Hejlsberg, and several features in common)
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Thank you so much for your response, it will help a great deal. From everything that I have read experince in C++ will make learning C# the easiest. Doing this paper has helped me to get a direction of what areas I want to concentrate on in programming.
Have a great day,
Aaron T.
|
|
|
|
|
Hi All,
I have just finished creating a small application and now am trying to package it into a setup program so that I can distribute it to the people concerned.
Where is the nice easy package creator program? or what am I supposed to do now?
Thanks,
|
|
|
|
|
If you are using VS 6.0 then it comes with a version of InstallShield that you can use to package your distribution.
If not then I would suggest getting a trial for any of the commercially available packages of trying the Windows MSI installer if your package warrants this complexity. Otherwise search google for shareware installer packages and give them a try. I have seen many over the years and it really depends on how complex your application is with regard to dependent components, license installation, registration, uninstall, user input and control of installation, etc.
Success is measured by ones ability to mask complexity with simplicity.
|
|
|
|