Skip to content

C#

C# discussions

This category can be followed from the open social web via the handle c-065f1d12@forum.codeproject.com

93.7k Topics 383.1k Posts
  • uxtheme.dll and windows XP themes in C#

    csharp help tutorial question c++
    5
    0 Votes
    5 Posts
    0 Views
    J
    akr0 wrote: then run the app, right click on your desktop and goto properties. look at the difference between the actual pages (not the tabs, the page colors)... this is where you need the uxtheme.dll... The page color issue is an acknowledged bug by MS. I'm sure there are other controls where this is a problem though which is why you'll need to P/Invoke to get around it until MS fixes it. akr0 wrote: there is an idea Please do :) I always look forward to new articles, especially on new topics such as this. James Sonork: Hasaki "I left there in the morning with their God tucked underneath my arm their half-assed smiles and the book of rules. So I asked this God a question and by way of firm reply, He said - I'm not the kind you have to wind up on Sundays." "Wind Up" from Aqualung, Jethro Tull 1971
  • Opacity

    question
    5
    0 Votes
    5 Posts
    0 Views
    M
    Thanks you,I'll do that. Mazy "The path you tread is narrow and the drop is shear and very high, The ravens all are watching from a vantage point near by, Apprehension creeping like a choo-train uo your spine, Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
  • how to immigrate c++'s union?

    c++ csharp tutorial question
    4
    0 Votes
    4 Posts
    0 Views
    L
    Well, I try to use set and get to simulate the union. It seems work in my eye. class A { public int a; } class B { public char b; } class union { object obj; public A aa { get { return (A)obj; } set { obj=value; } } public B bb { get { return (B)obj; } set { obj=value; } } }
  • can i "%.1f" in C#?

    question csharp
    4
    0 Votes
    4 Posts
    0 Views
    M
    Console.WriteLine("Test: {0:f1}", 765.7689); The result will be 765.8 instead of 765.7, but usually that is the preferred output... /moliate (just started learning C#)
  • 0 Votes
    2 Posts
    0 Views
    T
    This is actually a C++ question, but I'll answer it. There is not performance issue here just a stylistic one. I personally prefer static functions over global functions as they imply a link to a given context. Cheers, Tom Archer Author, Inside C#
  • Trouble with CollectionBase

    csharp help question
    3
    0 Votes
    3 Posts
    0 Views
    T
    There's nothing in the code you posted that would cause the problem you're describing. Can you post a sample app - especially the client code? Cheers, Tom Archer Author, Inside C#
  • Yes! Solution to compile MANIFEST resource into EXE ;)

    csharp com learning
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Can a component obtain a reference to its container object?

    question docker
    11
    0 Votes
    11 Posts
    0 Views
    J
    ah, maybe thats why I thought that :) James Sonork: Hasaki "I left there in the morning with their God tucked underneath my arm their half-assed smiles and the book of rules. So I asked this God a question and by way of firm reply, He said - I'm not the kind you have to wind up on Sundays." "Wind Up" from Aqualung, Jethro Tull 1971
  • converting images

    question
    3
    0 Votes
    3 Posts
    0 Views
    V
    Thanks, James. I didn't get it to work that way, either, but I tried something else with better results. I set the build property of each image I wanted to reference to 'Embedded Resource' rather than 'Content'. Then, I used the following routine to grab the icon from the assembly. public static Icon GetIcon(string iconName) { Assembly assemb = Assembly.GetEntryAssembly(); return new Icon(assemb.GetManifestResourceStream("mynamespace.myfolder." + iconName)); } Note that the case must be correct and the file extension and folder name must be included. vaMope
  • SendMessage/PostMessage via socket

    question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Manifest compiled into the EXE file

    tutorial question learning
    3
    0 Votes
    3 Posts
    0 Views
    S
    I've already tried it and it works neither "Embedded Resource" nor "Content".:(( I think it should be compiled as a Win32 resource and C# compiles it a little bit different (resx). But I'm not sure.
  • Scrolling

    java question
    3
    0 Votes
    3 Posts
    0 Views
    I
    10x, but how do I register for the scrollbars events? As far as I could see, these events wasn't accessible to a ScrollableControl like myself. What I used to do back in java was to override Paint and draw only the clip rectangle it gave me. That represented the viewport area out of the big I should have drawn without scrollbars. Is there any component like that (JSrollPane) out there? Inbal
  • Update The Screen

    question csharp com tutorial announcement
    4
    0 Votes
    4 Posts
    0 Views
    J
    You shouldn't have to worry about it, the windows timer functionality was designed so it wouldn't bog the system down by itself. If an application has events waiting for it the timer event won't fire. When the system does get to fire the time it will only send one event, not the entire backlog. If you have an excessively long task running it should be placed into a work thread so that the program doesn't appear to be locked up. In that case the main application thread is doing its own thing so it can keep up with event messages sent to it. HTH, James Sonork: Hasaki "I left there in the morning with their God tucked underneath my arm their half-assed smiles and the book of rules. So I asked this God a question and by way of firm reply, He said - I'm not the kind you have to wind up on Sundays." "Wind Up" from Aqualung, Jethro Tull 1971
  • RoundRect

    graphics csharp question
    4
    0 Votes
    4 Posts
    0 Views
    N
    Thanks both of you. I was hoping I was missing something and would not have to do it manually. I don't understand why they would not have brought RoundRect forward into C#/.NET, it seems like something that would be useful (at least to me).
  • Regular Expressions

    database question
    3
    0 Votes
    3 Posts
    0 Views
    C
    Just to clarfiy, you want to do a basic string search, which does not need RegEx. The point of a regular expression is that you can use wildcards, for example sh*p would find sheep, shlap any other combination that has an sh followed by any number of chars follwed by p. * would find anything and *.bmp would find all .bmp files. I don't remember any of the other wildcards off the top of my head :0) Christian The tragedy of cyberspace - that so much can travel so far, and yet mean so little. "I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?! - Jon Hulatt, 22/3/2002
  • 0 Votes
    3 Posts
    0 Views
    D
    If you are referring to .NET framework (you mentioned MFC), well, you can't: you have to redistribute dotnetfx.exe (~20Mb) and install on each client machine. Crivo Automated Credit Assessment
  • What is the code for exit inVC#?

    question csharp
    5
    0 Votes
    5 Posts
    0 Views
    J
    That is assuming you wish to close a windows form and it is the top-level form object. If you wish to exit out completely from a windows form application, System.Windows.Forms.Application.Exit();. I'm not sure how you would exit out of a console application. James Sonork: Hasaki "I left there in the morning with their God tucked underneath my arm their half-assed smiles and the book of rules. So I asked this God a question and by way of firm reply, He said - I'm not the kind you have to wind up on Sundays." "Wind Up" from Aqualung, Jethro Tull 1971
  • ListView Owner Draw

    question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • PrintPreview Dialog

    question
    7
    0 Votes
    7 Posts
    0 Views
    M
    James T. Johnson wrote: I still don't know why some items don't appear in IntelliSense, especially when its parent class contains something and its not changed in the sub-class. Me too. Thanks again James.:) 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
  • Socket Communications between C++ and C#

    help question csharp c++ sysadmin
    2
    0 Votes
    2 Posts
    0 Views
    J
    When you serialize a class extra data is written to tell the runtime what type of object is being serialized. I have no idea if MS put this functionality in but you can look to see if you can work something up between the StructLayout attribute (normally set to Sequential) and the MarshalAs attribute. Then try getting a byte[] array with that data. I just thought of a hack that might work; create a struct, with the first and last elements being an int containing magic numbers; serialize the data to a MemoryStream, then retrieve the bytes from it, using only the data between your magic numbers to send across the wire. Like I said its a hack, and its entirely dependent on how the binary formatter serializes data (assuming it serializes the data in the same order it is in your struct). James Sonork ID: 100.11138 - Hasaki "I left there in the morning with their God tucked underneath my arm their half-assed smiles and the book of rules. So I asked this God a question and by way of firm reply, He said - I'm not the kind you have to wind up on Sundays." "Wind Up" from Aqualung, Jethro Tull 1971