Jump to content
Xtreme .Net Talk

NewToC

Members
  • Posts

    10
  • Joined

  • Last visited

NewToC's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. When starting a new .NET application, what is the general method for determining how to size the forms used. Do most developers base this on the user's screen resolution? IS the main form usually full screen? If other sub-forms are smaller, how do you decide how big to make it and all the controls? If you have a full screen form and the buttons are 1/2 inch high, do you try to make all the buttons on smaller forms 1/2 inch high also, or size them "by eye" to look good?
  2. Here's one way: listMylist.Items.Clear(); string s1 = somedate; string s2 = moredata; string str = s1 + s2; listMylist.Items.Add(str);
  3. You are going to need to use ODBC instead of OLEDB
  4. Thanks for the response. The coding will be easy, I just wanted to be sure I understood the "accepted" method.
  5. I am not sure. Since a dot signifies any character except newline, you need a way to override that an just look for a character dot. I'm not sure of the answer.
  6. I am just starting to work with regular expressions so excuse me if I'm off base, but doesn't \d+ match one or more instances of a digit? So wouldn;t that stop at the decimal point?
  7. I have been looking at regex and can only see where it solves half the problem. Am I the only person who has ever tried to deal with a phone number in a text box in .net, or am I the only one too dense to figure out how? Please don't answer that. I can test the text like this: if !(Regex.Match(txtPhone.Text, @"^[1-9]\d{2}-[1-9]\d{2}-\d{4}$"))) {format it}; Can I use regular expressions to _create_ the formatted string? I can't quite see how. I could easily process each character in the string and insert the formatting characters, but if Regex can do it, that would be a nicer solution.
  8. Only the Double.Parse works, but that seems more efficient than processing the entire string. But then, how about a phone number? After the user enters one into a textbox, do you process it character by character into (999)999-9999 format, or is there a better way? This is all stuff the MaskEdit control did in earlier versions. I am just curious about the .NEt aternatives. Thank you for helping.
  9. Look again. Here's the line the compiler chokes on: PricetextBox.Text = PricetextBox.Text.ToString("N") Note I am trying to format the text in the text box, which is already a string. I'm not surprised it doesn't work, but it shows what I am trying to do. If the Text in the textbox is 123456 I could process it one character at a time to create a new string 123,456 - I just thought with all the power of .NET there would be an easier way. Is there?
  10. I am not new to programming but I am new to programming Windows controls. So let me ask the ultimate simple question. Beleive it or not, I have searched Help and a book or two and cant find a simple example. I have data in an SQL file that is a double. I want to display it in a text box and allow the user to edit it. I want it to appear in the format 999,999.99 when the form is populated. If the user changes the number, as they leave the textbox, change to format of the new number to 999,999.99. I do not want to use a MaskEdit control - I want a pure .Net solution. I am filling the textbox like this: PricetextBox.Text =prop.Price.ToString("N"); I need to put code in the PricetextBox_Validated event handler (or somewhere similar) that will put newly entered data in the same format. I tried PricetextBox.Text = PricetextBox.Text.ToString("N") but the compiler choked. In addition to an answer, I would also appreciate a link to some on line help in the entire text box input/output formatting area. Thanks
×
×
  • Create New...