Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
M

Matthew Cuba

@Matthew Cuba
About
Posts
53
Topics
7
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • return
    M Matthew Cuba

    Looks to me like Main() has a local variable 'sum' that is set to 10 but your call to a() doesn't reference that one - since it is local to Main and wasn't passed in - it references the 'sum' that is part of your class. Good Luck!

    “You can't teach people to be lazy - either they have it, or they don't.” -Dagwood Bumstead

    C# tutorial question learning

  • Collision
    M Matthew Cuba

    FYI - If you are interested in theory with a little code - mind you it is C++ but that's not important, check out the book "Beginning Math and Physics for Game Programmers" by Wendy Stahler. It is pretty good and might help you with game development. ISBN is 0-7357-1390-1. Anyhow, I found it to be invaluable in my game/physics programming. Good Luck!

    “You can't teach people to be lazy - either they have it, or they don't.” -Dagwood Bumstead

    C# learning

  • I need a file viewr please
    M Matthew Cuba

    hom_rcp wrote:

    i need a file viewer can open images ,video ,audio ,pdf ... formats . How can i find the source for it in C# or component only?

    I'd recommend a site called Code Project. I hear that folks sometimes have examples on that site that you can download and look at the source. You should check there. :) Definitely it isn't hard to view an image file - PictureBox will do that. Video and Audio can be viewed using the Quartz plugin or the MediaPlayer plugin. I suspect there is a PDF viewer too, though I haven't bothered looking for one. Good Luck!

    “You can't teach people to be lazy - either they have it, or they don't.” -Dagwood Bumstead

    C# question csharp help

  • How to convert a char from IO stream into an int please
    M Matthew Cuba

    Probably an easier way but this seems to work: int val = Convert.ToInt32(e.KeyChar.ToString()); Good Luck!

    “You can't teach people to be lazy - either they have it, or they don't.” -Dagwood Bumbstead

    C# tutorial

  • Getting InvalidOperationException when I modify an arraylist
    M Matthew Cuba

    humblepgmr wrote:

    foreach (myobject value in copy){ ... copy.RemoveAt(copy.IndexOf(value)); ... }

    Hi there, There was some information at Microsoft about this. You might consider checking out http://support.microsoft.com/kb/555972 to read about it. Looks like a workaround involves creating a copy of the collection within the foreach loop. Good Luck!

    You can't teach people to be lazy - either they have it, or they don't. -Dagwood Bumbstead

    C# question discussion

  • How would i go about programming an excel like worksheet??
    M Matthew Cuba

    kranius wrote:

    I generally mean the cell like structure.. Is this jsut a panel with a grid on it and mouse events to track which cell the user mouse is over??

    Perhaps a DataGridView would be a place to start. Just a suggestion. I'm sure there are an infinite number of ways to solve the problem, but I'd likely start there. Good Luck

    “You can't teach people to be lazy - either they have it, or they don't.” -Dagwood Bumbstead

    C# css question

  • Different Controls
    M Matthew Cuba

    There's a Search box at the top of the Code Project website. I was able to find examples with precious little effort on my part - try it out sometime!

    “You can't teach people to be lazy - either they have it, or they don't.” -Dagwood Bumbstead

    C# csharp tutorial

  • Data Grid View Row Header
    M Matthew Cuba

    Yes. Take a look at the DataGridView documentation - it is really quite easy once you get the idea that the header cell is similar to other cells in the datagridview. Suppose you wanted to set the text for row 0's row header... you could do this: dataGridView1.Rows[0].HeaderCell.Value = "Some String"; Good Luck!

    It isn't enough to do well in life. One must do good when and where one can. Otherwise, what's the point?

    C# css question

  • textbox check
    M Matthew Cuba

    Djavid j wrote:

    I have a textbox. how can i avoid that a user types strings in it, bud only decimal values?

    MaskedTextBox could be used, or you could handle the Key events (KeyDown, KeyPress, KeyUp) and look at what was typed there, only allowing characters that pass your criteria through. There may be other ways. Good Luck!

    It isn't enough to do well in life. One must do good when and where one can. Otherwise, what's the point?

    C# question

  • How do i....
    M Matthew Cuba

    MMaines2005 wrote:

    how would i get me Visual C# to load a image i have loaded to a resource files in this script:

    If I wanted to, say, load an image from a resource and display it in my PictureBox, I might do this: myPictureBox.Image = Properties.Resources.myImageToDisplay;

    It isn't enough to do well in life. One must do good when and where one can. Otherwise, what's the point?

    C# csharp graphics game-dev tools help

  • Picturebox
    M Matthew Cuba

    DanSteeve wrote:

    I want to execute some code when I click a picturebox, but I don't know how, and I can't find an answer anywhere. So could some kind person out there take some time to teach me?

    You can just handle the Click event by creating an event handler that does whatever you want it to do. example: myPictureBox.Click += new PictureBox.Click(myFunctionToDoSomething); private void myFunctionToDoSomething(object sender, EventArgs e) { // your stuff } Seems like that would do the trick. I'm assuming the code you want to execute is part of your application, of course. You could fire off another process within the event handler, if you wanted. Hope that helps!

    It isn't enough to do well in life. One must do good when and where one can. Otherwise, what's the point?

    C# question

  • How do i....
    M Matthew Cuba

    C# Beginner Nick wrote:

    Forum C# Subject: Re: How do i.... Sender: C# Beginner Nick Date: 21:17 3 Oct '07 How would I, make a picture show up in the buttom right corner and allow me to click/hold and move it anywhere and it will drop back down to the status bar and walk back to the bottom right corner? I'm not very good at coding. I've only been looking and learning for the last few days off of here. Also, how would i add in a initialize program code? What i mean by that is; A code that when i click the button it will open the correct program i list to it. For Example: The button says 'Enternet' I'd like when i click it, it will open Enternet Explorer for me. Any help would be appreciated.

    Honestly, I'd encourage you to work through a C# book's exercises first if you are just starting out. Spend some quality time with Visual Studio (Express Edition is fine) and read lots and write lots of code. It is unclear to me what you are trying to accomplish, but I think you'll be much more successful if you start out learning the language and working through some exercises. It might seem "boring" or "a waste of time", but it isn't, really. Good Luck!

    TODO: Find a witty quote by someone famous to put here.

    C# question help tutorial learning

  • Bound datagridvewview column ordering confusion
    M Matthew Cuba

    Hello, So, I've got a DataGridView that is bound to some data in a DataTable. I only show a subset of the columns and additionally have two non-bound columns in the DataGridView. I've attempted to set the column ordering via the DisplayIndex property to no avail. If I attempt to set the DisplayIndex for each in ascending order such as: column0.DisplayIndex = 0; column1.DisplayIndex = 1; . . . column9.DisplayIndex = 9; the columns don't order correctly. They end up showing up as follows (numbers are the order that I specified them in): 0, 1, 2, 6, 8, 4, 7, 3, 9, 5 The two non-bound columns are 6 and 8 and are DataGridViewImagaColumns. The others are text columns. Has anyone else had such a problem and solved it? I saw some similar questions asked in my google searching but didn't see a solution to this. I wonder if it is a bug or perhaps I'm just missing something here. Thanks for you help, Matt

    TODO: Think up something witty to put here.

    C# help algorithms question

  • More if's?
    M Matthew Cuba

    Hi,

    MasterSharp wrote:

    Forum C# Subject: Re: More if's? Sender: MasterSharp Date: 20:08 1 Oct '07 How do you make it so an if statement has a lot of things to match? It's hard to explain, but instead of '&&', is there a way to make it so you can have a bunch of if's to follow? I hope you understand what I mean... Thanks in advance, M.S.

    The long and short of it is that you can chain together as many expressions as you like with &&'s and ||'s. I'd recommend picking up an introductory C# book - there are a number of good ones. Jesse Liberty's "Learning C#" is a good one, or you might find the Head First C# book interesting to read - it isn't your standard C# text. Apress has some good ones too. I have several books on the subject and each provides a different perspective. I think that you'd really benefit by getting one of these books and working through it. Most have exercises, and those are helpful. There are a bunch of great folks here at Code Project who can answer questions, but you're not going to learn the language nearly as well as if you invest some time with a good text - your question indicates that you are new to the language and probably haven't worked through an introductory text, because just about any good introductory text would have provided the answer to that question and TONS of others you are likely to have along the way. .NET development, and programming in general, is a journey and NONE of us has it all figured out - if you'll invest the time upfront with a good text on the language, and then experiment along the way, read the MS-provided help pages, you'll likely be quite capable at developing C# apps in a reasonable period of time. Of course, when you are stumped on a program, there are a bunch of folks here that would be happy to take a look at the code snippet and respond. At least that has been my experience. Good Luck!

    It isn't enough to do well in life. One must do good when and where one can. Otherwise, what's the point?

    C# regex question

  • string to character
    M Matthew Cuba

    Hi, I would take a look at this page: http://msdn2.microsoft.com/en-us/library/system.string(VS.80).aspx[^] to see Microsoft's info on the String class. Good luck!

    It isn't enough to do well in life. One must do good when and where one can. Otherwise, what's the point?

    C#

  • Coding Standard Question
    M Matthew Cuba

    donsolms wrote:

    Which is better according to coding standard for c#? this: public bool isDraggable { get { return _draggable; } set { _draggable = value; } } or this: public bool isDraggable{ get; set; } without using private members? Or is this a matter of personal choice?

    Hi, For Orcas, I thought that these were essentially identical, that the compiler would generate some private fields for you. Perhaps I've missed something - I'm living in a .NET 2.0 world - but, that was my understanding of it. I suspect someone will correct me if I'm wrong. Hope that helps.

    It isn't enough to do well in life. One must do good when and where one can. Otherwise, what's the point?

    C# question csharp

  • Writing To A Text File
    M Matthew Cuba

    If PITEMNAME's length is > 45, it is going to push everything over. You could truncate at 45 or you look at all the PITEMNAME values (assuming you are looping and trying to dump out data in columns) and set the pad accordingly rather than specifying 45. If you are limited to your width and 45 is max, truncating is what I'd do, probably. Good Luck!

    It isn't enough to do well in life. One must do good when and where one can. Otherwise, what's the point?

    C# help question

  • How to extract HTML code From any webpage using C#.Net
    M Matthew Cuba

    allivelu wrote:

    How to extract html code any web site using C#.Net I mean : http://www.yahoo.com----in that site find the Urls,Emailid,phone

    I'm not sure exactly what you want. If you are looking to get the HTML for a webpage, load it in a WebBrowser object and use the DocumentText property to retrieve the HTML as a string. If you are looking for the URLs, email, and phone numbers, you'll need to look at the string you got from calling browser.DocumentText for substrings that match the pattern of a URL, email address or phone number. The Regex class is what you might want to look at, since that is *really* helpful at doing pattern matching. Good Luck!

    It isn't enough to do well in life. One must do good when and where one can. Otherwise, what's the point?

    C# csharp html com tutorial

  • How make button F1 ( Help ) enable in my application ?
    M Matthew Cuba

    Why not add a System.Windows.Forms.HelpProvider by dropping one onto your form, set its HelpNamespace to the .chm file you want to open and then in your form's properties, set the HelpKeyword and HelpNavigator properties? the Visual Studio 2005 documentation has an example in C# for the HelpProvider class. Good Luck!

    It isn't enough to do well in life. One must do good when and where one can. Otherwise, what's the point?

    C# help tutorial question

  • writing data in config file
    M Matthew Cuba

    gajesh wrote:

    The problem is that internally(while debugging the application i saw) it knows that the particular data has been modified and reads the modified data but these changes are not reflected in app.config file.

    I had a couple of thoughts on this, though I'm not an expert: When you are running in debug mode, I thought it wrote changes to a temporary config file in the Debug directory rather than in the project directory. You might check that. Also, how are you writing out application-scoped settings? I know that user-scoped ones can be assigned, but I thought application ones were read-only. I know you can read the XML yourself and do it, but I *thought* only user settings were writable. Good Luck!

    It isn't enough to do well in life. One must do good when and where one can. Otherwise, what's the point?

    C# csharp design help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups