|
I am working with .NET 2.0, and using Application.EnableVisualStyles(); . The first image is the end product.
-----
Note: *** Never give me an answer have anything to do with Visual Studio. I don't have this program, and it'll be that way for a long, long time. ***
|
|
|
|
|
Have you made sure that you're using the ToolStrip and MenuStrip classes instead of the old MenuBar and Toolbar classes, and that their RenderMode properties are set to ToolStripRenderMode.Professional , or are set to ToolStripRenderMode.ManagerRenderMode with the Renderer set to an instance of the ToolStripProfessionalRenderer class?
|
|
|
|
|
The first one is using the System.Windows.Forms.Menu. The second one is using the System.Windows.Forms.MenuStrip.
|
|
|
|
|
Ahh... Thanks!
-----
Note: *** Never give me an answer have anything to do with Visual Studio. I don't have this program, and it'll be that way for a long, long time. ***
|
|
|
|
|
Hi all!
Having some trouble with converting this logic into some nice C# code! can anyone help??
1. Get the "twos complement" of a number (invert, add 1)
2. Get the LSB of that result...
Example with: 1506
1506 = 10111100010
Invert = 01000011101
Add 1 = 01000011110
2*LSB = 00011110
Result = 00011110 (or 1E in hex)
Can anyone point me in the right direction to get these results in C# please!
|
|
|
|
|
int val = 1506;
int result = (~val + 1) & 0X000000FF;
|
|
|
|
|
What would be a good C# programming manner to extract from a 32-bit value the different bytes (MSB to LSB) in big or little endian format?
|
|
|
|
|
Do an && to strip the bits you don't want, and shift them down with >>
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
There is an alternative, that may be interesting when many variables need to
available in both packed and unpacked form.
Using structs you can obtain a "union" effect in C# in the following way:
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Explicit)]
public struct Overlay {
[FieldOffset(0)]public uint u32;
[FieldOffset(0)]public byte u8_0;
[FieldOffset(1)]public byte u8_1;
[FieldOffset(2)]public byte u8_2;
[FieldOffset(3)]public byte u8_3;
}
public override void Run() {
Overlay overlay=new Overlay();
overlay.u32=0x12345678;
log("lo to hi: "+overlay.u8_0.ToString("X2")+" "+overlay.u8_1.ToString("X2")+
" "+overlay.u8_2.ToString("X2")+" "+overlay.u8_3.ToString("X2"));
}
On a little-endian machine (such as Intel x86) the Run method will log
"lo to hi: 78 56 34 12"
Be careful though, you are responsible for the offset values !
-- modified at 11:54 Sunday 4th February, 2007
Luc Pattyn
|
|
|
|
|
I want my program to be able to dock on any side of the screen and have all of the other windows to resize so that my program gets its own space. (Bad example, but kind of like the taskbar)
thanks!
|
|
|
|
|
hi
i want to set focus on specified row in My datagridview, how to do ?
thanks
|
|
|
|
|
Try this:
DatGridView1.CurrentCell = DatGridView1.Rows[RowIndex].Cells[0];
|
|
|
|
|
I'm not asking for a complete program or anything, but if I was going to make an application that would allow people to communicate from different computers via the web (similar to AOL Instant Messenger), how would I go about doing it? Something to get me started would be helpful. Thanks!
-----
Note: *** Never give me an answer have anything to do with Visual Studio. I don't have this program, and it'll be that way for a long, long time. ***
|
|
|
|
|
max29297 wrote: I'm not asking for a complete program or anything, but if I was going to make an application that would allow people to communicate from different computers via the web (similar to AOL Instant Messenger), how would I go about doing it? Something to get me started would be helpful. Thanks!
This article[^] should give you some pointers.
|
|
|
|
|
Thanks a lot!
-----
Note: *** Never give me an answer have anything to do with Visual Studio. I don't have this program, and it'll be that way for a long, long time. ***
|
|
|
|
|
can anyone tell me how wrappers are created. im relatively new to c#. i want to create wrappers to a c++ process code in C#?
|
|
|
|
|
To get from C++ to C#, you probably want to use p/invoke, if the C++ code is in a dll. Another option is to write it in C++/CLI, which .NET can call. Depending on the process and the code involved, a C# rewrite may be an option ( this is usually best, with p/invoke for any calls you need to make to Win32 functions )
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi , i stored my connection in application settings i.e. project > properties> settings tab.
Now i need to access the connection string from code. How do i do it ??
any help is appreciated,
yojimbo
|
|
|
|
|
Hello,
I'm currently working on a project.
I use icons for my tool bars, ListViews etc.
The problem is that I sometimes need to use the same icon more than once, but in a different ListView, or tool bar.
When using a tool bar there's no problem because I can add an icon as a resource, and later on use this resource without adding it again and again.
However if I take a ListView, which of course needs an ImageList to display its icons, I have to add the same icons to the ImageList over and over again.
Does VS know not to add the same icon file to the exe twice?
Should I add the icons as resources, and then add those resources to the ImageLists using code?
Thanks in advance,
Shy.
|
|
|
|
|
hello
i wanto create an application (C#) like "free download manager" for download files.
i use "System.Net.WebClient" class for this .
such as following
...
string filename
System.Net.WebClient client = new System.Net.WebClient();
....
try
{
Uri uri = new Uri(urlTextBox.Text);
string fileName = System.IO.Path.GetFileName(urlTextBox.Text);
string downloadString = client.DownloadString(uri);
this.toolStripProgressBar1.Value = 0;
client.DownloadFileAsync(uri, fileName);
this.downloadButton.Text = "Cancel";
isBusy = true;
}
catch (UriFormatException ex)
{
MessageBox.Show(ex.Message);
}
...
my problem in use of this class is, i don't know how recognize file extension (in my code "fileName" vaiable) to download like .txt, .pdf
|
|
|
|
|
hi
you can verify the url when the Download url is entered in the textBox like
[CODE]
string s="http://www.google.com/file.txt";
if(s.EndsWith(".pdf")||s.EndsWith(".exe")))
{
//call the function for file download
}
else
//error message
[/CODE]
Q@!$3r
|
|
|
|
|
string fileExtention = System.IO.Path.GetExtension(urlTextBox.Text);
|
|
|
|
|
hmm just wondering how to check if the download url is like this..
http://www.some-site.com/sessionid/file?get=74
Like many site don't provide direct download link to prevent leeching ...
Q@!$3r
|
|
|
|
|
yes
my problem is this
|
|
|
|
|
hmm, try send WebRequest to url like this, and watch what the WebResponse is doing (or maybe the WebResponse's stream).. or create function to handle redirections, which MUST come from the WebResponse...
VirtualVoid.NET
|
|
|
|