Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

You can also use ToString()

yes, you can, it's a matter of preference :)

You can certainly use int32VariableName.ToString() if it's not already in string form.

My point, however, was that it SHOULD be in string form already if it's contained in a textBox :twisted:

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

While I'm sure you've already done so... I have to ask anyway.

Did you check Google?

A second search at Google.

Not knowing of any tools to recommend myself that's all I can do for ya :)

Hope it helps.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

So you got it working now? Which version did you use in the end? the version that utilizes the methods and private variables in the Calculator class? or the version that directly derives the answer from the Equals procedure?

Oh, and if it's solved, please remember to mark the thread as solved as well :P

tricket_7 commented: Help was thorough, and helped me to also understand what I was doing. +1
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

>> Warning 1 Field 'Project_12_1_Create_Basic_Calculator.frmCalculator.secondNumber' is never assigned to, and will always have its default value 0 as I said above, when you hit the equals button you need to assign the current visible number to secondNumber first :)

>>Warning 2 The field 'Project_12_1_Create_Basic_Calculator.frmCalculator.answerNumber' is never used
Wherever you have answerNumber declared in your frmCalculator form just place a // before it to comment it out as this version of the code doesn't use it.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

In your code you had your methods for declaring your variables, in mine I didn't so that's why I drew the results directly from separate textboxes (just to test them).

In your case you don't need to additionally declare

double firstNum = Convert.ToDouble(firstNumber.Text);
double secondNum = Convert.ToDouble(secondNumber.Text);
string arithProc = arithmeticProcess.Text;

Within your button click as you already have them declared as part of the other processes (at least firstNumber and arithmeticProcess) however you do need to put the 2nd number value into the variable when the equals button is pressed in order to pass the value to the Calculator class.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

To illustrate the 2nd possibility where the actual methods and such are actually utilized (which I assume may be part of your assignment) I used the same form with 4 text boxes and 1 button but changed the Calculator class to this:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace testApp
{
    public class Calculator
    {
        private string arithmeticProcess;
        private double firstNumber;
        private double secondNumber;
        private double answerNumber;

        public Calculator()
        {
        }

        public void setVars(double firstNum, double secondNum, string arithProc)
        {
            ArithmeticProcess = arithProc;
            FirstNumber = firstNum;
            SecondNumber = secondNum;
        }

        public string ArithmeticProcess
        {
            get
            {
                return arithmeticProcess;
            }
            set
            {
                arithmeticProcess = value;
            }
        }

        public double FirstNumber
        {
            get
            {
                return firstNumber;
            }
            set
            {
                firstNumber = value;
            }
        }

        public double SecondNumber
        {
            get
            {
                return secondNumber;
            }
            set
            {
                secondNumber = value;
            }
        }

        public double AnswerNumber
        {
            get
            {
                return answerNumber;
            }
            set
            {
                answerNumber = value;
            }
        }

        public void Equals()
        {

            if (ArithmeticProcess == "+")
            {
                AnswerNumber = FirstNumber + SecondNumber;

            }
            else if (ArithmeticProcess == "-")
            {
                AnswerNumber = FirstNumber - SecondNumber;

            }
            else if (ArithmeticProcess == "*")
            {
                AnswerNumber = FirstNumber * SecondNumber;

            }
            else if (arithmeticProcess == "/")
            {
                AnswerNumber = FirstNumber / SecondNumber;

            }
        }

        public string GetDisplayText()
        {
            return AnswerNumber.ToString();
        }
    }
}

And then I changed the form1.cs to this:

Calculator newCalc = new Calculator(); //Create instance of Calculator called newCalc

        private void btnEquals_Click(object sender, EventArgs e)
        {
            double firstNum = …
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Ok... I debug'd using the following (because you need this info to see what I did):

  1. I created a blank form and populated it with 4x textBox
  2. textBox1 was renamed firstNumber
  3. textBox2 was renamed arithmeticProcess
  4. textBox3 was renamed secondNumber
  5. textBox4 was renamed txtDisplay
  6. I added 1 button and named it btnEquals

At this point I created the Calculator class (the only difference here from what you will need is the namespace)

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace testApp
{
    public class Calculator
    {
        public string arithmeticProcess;
        public double firstNumber;
        public double secondNumber;
        public double answerNumber;

        public Calculator()
        {
        }

        public Calculator(string arithmeticProcess, double firstNumber, double secondNumber, double answerNumber)
        {
            this.FirstNumber = firstNumber;
            this.ArithmeticProcess = arithmeticProcess;
            this.SecondNumber = secondNumber;
            this.answerNumber = answerNumber;

        }

        public string ArithmeticProcess
        {
            get
            {
                return arithmeticProcess;
            }
            set
            {
                arithmeticProcess = value;
            }
        }

        public double FirstNumber
        {
            get
            {
                return firstNumber;
            }
            set
            {
                firstNumber = value;
            }
        }

        public double SecondNumber
        {
            get
            {
                return secondNumber;
            }
            set
            {
                secondNumber = value;
            }
        }

        public double AnswerNumber
        {
            get
            {
                return answerNumber;
            }
            set
            {
                answerNumber = value;
            }
        }

        public double Equals(double firstNumber, double secondNumber, string arithmeticProcess)
        {

            if (arithmeticProcess == "+")
            {
                answerNumber = firstNumber + secondNumber;

            }
            else if (arithmeticProcess == "-")
            {
                answerNumber = firstNumber - secondNumber;

            }
            else if (arithmeticProcess == "*")
            {
                answerNumber = firstNumber * secondNumber;

            }
            else if (arithmeticProcess == "/")
            {
                answerNumber = firstNumber / secondNumber;

            }
            return …
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

one sec... I want to try it in my VS and see where I buggered it before posting again lol

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Sry, ok... try copy/pasting the code I gave you in this post directly.

It's all your original code with my modifications so you should be able to copy from top to bottom of the Calculator class code to completely overwrite your existing Calculator class code. Use the Toggle Plain Text option to give direct access to the code without the numbers being copied too.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

still getting the same error messages...
here is the modified code

Main Form

private void btnEquals_Click(System.Object sender, System.EventArgs e)
        {
            Calculator newCalc = new Calculator();
            txtDisplay.Text = Convert.ToString(newCalc.Equals(firstNumber, secondNumber, arithmeticProcess));
         
        }

Calculator Class

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Project_12_1_Create_Basic_Calculator
{
    public class Calculator
    {
        public string arithmeticProcess;
        public double firstNumber;
        public double secondNumber;
        public double answerNumber;
        
        public Calculator()
        {
        }

        public Calculator(string arithmeticProcess, double firstNumber, double secondNumber, double answerNumber)
        {
            this.FirstNumber = firstNumber;
            this.ArithmeticProcess = arithmeticProcess;            
            this.SecondNumber = secondNumber;
            this.answerNumber = answerNumber;
            
        }

        public string ArithmeticProcess
        {
            get
            {
                return arithmeticProcess;
            }
            set
            {
                arithmeticProcess = value;
            }
        }

        public double FirstNumber
        {
            get
            {
                return firstNumber;
            }
            set
           {
               firstNumber = value;
            }
        }

        public double SecondNumber
        {
            get
            {
                return secondNumber;
            }
            set
            {
                secondNumber = value;
            }
        }

        public double AnswerNumber
        {
            get
            {
                return answerNumber;
            }
            set
            {
                answerNumber = value;
            }
        }

        public static double Equals(double firstNumber, double secondNumber, string arithmeticProcess)
        {
            double answerNumber;
            if (arithmeticProcess == "+")
            {
                answerNumber = firstNumber + secondNumber;
                
            }
             else if (arithmeticProcess == "-")
            {
                answerNumber = firstNumber - secondNumber;
                
            }
            else if (arithmeticProcess == "*")
            {
               answerNumber = firstNumber * secondNumber;
                
            }
            else if (arithmeticProcess == "/")
            {
                answerNumber = firstNumber / secondNumber;
                
            }
            return answerNumber;
        }

           
    }
}

You've double-declared answerNumber, try just copy/pasting my prior example :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

As a side note, you did an excellent job declaring methods for getting and setting the values of your class variables.

However, this is really only necessary when:

  1. Your variables are "private" or otherwise not visible outside the class
  2. You have procedures to set/retrieve the variables

An example of using the methods you set would be:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Project_12_1_Create_Basic_Calculator
{
    public class Calculator
    {
        private string arithmeticProcess;
        private double firstNumber;
        private double secondNumber;
        private double answerNumber;
        
        public Calculator()
        {
        }

        public void setVars(double firstNum, double secondNum, string arithProc)
        {
            ArithmeticProcess = arithProc;
            FirstNumber = firstNum;
            SecondNumber = secondNum;
        }

        public string ArithmeticProcess
        {
            get
            {
                return arithmeticProcess;
            }
            set
            {
                arithmeticProcess = value;
            }
        }

        public double FirstNumber
        {
            get
            {
                return firstNumber;
            }
            set
           {
               firstNumber = value;
            }
        }

        public double SecondNumber
        {
            get
            {
                return secondNumber;
            }
            set
            {
                secondNumber = value;
            }
        }

        public double AnswerNumber
        {
            get
            {
                return answerNumber;
            }
            set
            {
                answerNumber = value;
            }
        }

        public static void Equals()
        {
            
            if (ArithmeticProcess == "+")
            {
                AnswerNumber = FirstNumber + SecondNumber;
                
            }
             else if (ArithmeticProcess == "-")
            {
                AnswerNumber = FirstNumber - SecondNumber;
                
            }
            else if (ArithmeticProcess == "*")
            {
               AnswerNumber = FirstNumber * SecondNumber;
                
            }
            else if (arithmeticProcess == "/")
            {
                AnswerNumber = FirstNumber / SecondNumber;
                
            }
        }

        public static string GetDisplayText()
        {
            return AnswerNumber.ToString();
        }
    }
}

make note of the CAPITAL letters vs the lower case letters. And …

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Use of unassigned local variable 'answerNumber'

Which also reminds me... answerNumber needs to be defined as a double in your Program class as well, I assumed it was declared in the excluded portion of the Program class prior to the button click event. Tho in the example I provided a moment ago, this is not required as I take the result of the Equals procedure and apply it directly to the text box.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Ok... I was probably somewhat confusing in how I worded it the last time so here it is step by step :)

First, your program class:

Calculator newCalc = new Calculator(); //Create instance of Calculator called newCalc

private void btnEquals_Click(System.Object sender, System.EventArgs e)
    {            
        txtDisplay.Text = Convert.ToString(newCalc.Equals(firstNumber, secondNumber, arithmeticProcess));         
    }

Then the Calculator class:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Project_12_1_Create_Basic_Calculator
{
    public class Calculator
    {
        public string arithmeticProcess;
        public double firstNumber;
        public double secondNumber;
        public double answerNumber;
        
        public Calculator()
        {
        }

        public Calculator(string arithmeticProcess, double firstNumber, double secondNumber, double answerNumber)
        {
            this.FirstNumber = firstNumber;
            this.ArithmeticProcess = arithmeticProcess;            
            this.SecondNumber = secondNumber;
            this.answerNumber = answerNumber;
            
        }

        public string ArithmeticProcess
        {
            get
            {
                return arithmeticProcess;
            }
            set
            {
                arithmeticProcess = value;
            }
        }

        public double FirstNumber
        {
            get
            {
                return firstNumber;
            }
            set
           {
               firstNumber = value;
            }
        }

        public double SecondNumber
        {
            get
            {
                return secondNumber;
            }
            set
            {
                secondNumber = value;
            }
        }

        public double AnswerNumber
        {
            get
            {
                return answerNumber;
            }
            set
            {
                answerNumber = value;
            }
        }

        public static double Equals(double firstNumber, double secondNumber, string arithmeticProcess)
        {
            
            if (arithmeticProcess == "+")
            {
                answerNumber = firstNumber + secondNumber;
                
            }
             else if (arithmeticProcess == "-")
            {
                answerNumber = firstNumber - secondNumber;
                
            }
            else if (arithmeticProcess == "*")
            {
               answerNumber = firstNumber * secondNumber;
                
            }
            else if (arithmeticProcess == "/")
            {
                answerNumber = firstNumber / secondNumber;
                
            }
            return answerNumber;
        }

            /*public static string GetDisplayText(double answerNumber)
            {
                return answerNumber.ToString();
            }*/
    }
}

MOST of the stuff …

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

I've got a bit of a concern in the way the information is being passed to the calculator class and in the way the answer textbox is being populated.

First:

answerNumber = Calculator.Equals(firstNumber, secondNumber, arithmeticProcess, answerNumber);

It appears as if you're passing answerNumber to the calculator to get back a value of answerNumber. Realistically the values to be passed to the calculator should be just firstNumber, secondNumber, arithmeticProcess (and the calculator class should be adjusted to accept those 3 inputs).

Second:

txtDisplay.Text = Calculator.GetDisplayText(answerNumber);

Again it looks as though you are passing the answer back to the calculator... for it to pass you back the answer. If anything, once the calculator has passed you back the answer (via Return answerNumber in the calculator class) you should be simply transferring this value to the textBox and not passing it right back to the calculator for it to pass back as a string.

Alternate method: Instead of using a return value on the Equals process, simply store the information in the variable answerNumber within the calculator class. Then, use the GetDisplayText() process to call the locally stored answerNumber variable within it's own class and return it to you in text form for the textBox.

So... basically... I would do it one of two ways:

private void btnEquals_Click(System.Object sender, System.EventArgs e)
{
    Calculator.Equals(firstNumber, secondNumber, arithmeticProcess);
    txtDisplay.Text = Calculator.GetDisplayText();
}

Where the Equals procedure in the calculator class takes 3 variables and stores the answer within the …

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

HA!!! I can't believe I didn't see this before...

You've got it working just fine... the only thing you're doing wrong is your div statements.

Change <div class="leftbox"> and <div class="rightbox"> to <div id="leftbox"> and <div id="rightbox"> and you should be golden. Oh, and ya, change the rightbox definition's float to right instead of left.

I did some testing of my own and with the following CSS:

#wrap {
	width: 1024px;
	margin: 0 auto;
}
#leftbox {
	width: 678px;
	float: left;
}
#rightbox {
	width: 346px;
	float: right;
}

and the following HTML

<body>
<div id="wrap">
    <div id="leftbox">
        Featured Content
    </div>
    <div id="rightbox">
        Recent Threads
    </div>
</div>
</body>

I get a 2-column effect as intended but if I used "<div class=" instead they appeared one on top of each other.

Hope this helps :) Please mark solved if your problem is resolved.

samw1 commented: Thank you!! It worked. Some many hours wasted for such all small thing. +0
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Something I didn't think of before...

Divs default to having some padding to their "container" which could be causing an issue since your two (left and right) divs add up to a total combined width of 1024 and are being placed inside a div of width 1024.

You may want to make sure you a) set all padding to 0 and b) possibly shrink the component divs by a few pixels so they don't overload the containing wrapper div.

Also, ya, my brain doesn't work today cus I actually DELETED your #'s when I was copying your example and they were there in the first place :P

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

I'm way too warm and my brain's not workin' right today but...

You have:

wrap {width:1024px;overflow:hidden;margin: 0 auto;background-image:url(sources/wrapbg.jpg);}
leftbox {width:678px;overflow:hidden;float:left;}
rightbox {width:346px;overflow:hidden;float:left;}

And I'm kinda thinking that rightbox should be:

rightbox {width:346px;overflow:hidden;float:right;}

But again, I've been having an off day today so I could be 100% wrong on this :P

Hope this helps :) Please mark as solved if it resolves your issue.

Edit: I'm also wondering why those "classes" don't have a # or . notation to them but *shrug* not gonna concern myself with the little things hehe

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Ya, sorry Ardav lol I've just been too darned warm here to think straight, I tried to compensate for it in my edit but... basically my point was you can use css classes in multiple varieties to alter the buttons :P

I think what I semi-realized after I posted (hense the edit) was that they may have been trying to create the buttons at the css level. Oh well, chalk it up to "Not one of Lu's better days" :P

Edit: Not that it matters as the OP hasn't gotten back to his own thread anyway lol

Edit 2: I think what happened there was I copy/pasted their original, and had been working a lot in background/div style CSS responses earlier, and just kinda ran with it... or something.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Hmm... this went from solved to unsolved (it was flagged solved earlier) for no apparent reason :P

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

I have not given much rep, so even my rep was from newbies, there is maybe left from yesterdays troubles in DaniWeb.

Actually your reply beat out my explanation :P

Thanks for the attempted bump tho, it's appreciated nonetheless.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

This might help. Not entirely sure if it'll do what you need it to but it seems like it might.

Hope this helps :) Please mark solved if it resolves your issue.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

I agree but I believe it's just a built in function of the vBulletin source that this site was built over top of (again from what I was reading in that linked thread) so it'd probably be more hassle than it's worth to go in and re-code that :)

Edit: and either the rep thing is broken today or you, as well, have exceeded your reputation giving alottment for the day :P I know I've been able to up peoples' rep today because I check after giving to make sure it was received so *shrug* dunno lol

Edit 2: And I was just informed that "Everybody gives gray rep in the Feedback forum (and Geek's Lounge and a couple of other places) :) " so that answers that hehe... Thanks Jonsca!!

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

either way, if you have a variable that is int32 and you want it as a string you can use:

string newString = Convert.ToString(int32Variable);

But as I said, any content of a textBox is already a string, therefor is a text value not an integer... so you should just be able to call textBoxName.Text to get your string value as it seems your .dll has already pre-converted the int32 value to a string in order to populate it into the textbox in the first place.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Glad to help :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Have you tried using excelApp.Sheets[0] for the first sheet, excelApp.Sheets[1] for the second sheet and so on?

This page at msdn.microsoft.com is a good reference point for finding the various properties that are available within the Excel.Application class.

Hope this helps :) Please mark as solved if it resolves your issue.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

I'm confused...

>> int32 is inside the text box
and
>> I would like to convert the int32 to text.

are somewhat mutually exclusive.

If it's already within a textBox then it is already text... simply use

string myInt32AsText = textBoxName.Text;

Obviously somewhere else in your code the Int32 has already been converted to text (explicitly or implicitly) prior to being inserted into the textBox.

Hope this helps :) Please mark as solved if this resolves your issue.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Sandeep929;

Looking at the 2 posts you've made, both look as though you copy/pasted the questions off of your computer programming class homework.

Please provide details of the nature of the problem you are having, as well as code snippets from attempts you have made at solving the problem, so that people have an idea of how to help you.

If, on the other hand, you expect us to do your homework for you... Well, speaking personally, not gonna happen. :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

First, (silly question but I have to ask) is the .css file saved?

Second, try adding

<style type="text/css">
<!--
@import url("site_layout.css");
-->
</style>

For some reason I find @import works better than "<link href="/site_layout.css" rel="stylesheet" type="text/css">" for me.

Hope this helps :) Please mark as solved if this resolves your issue.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

For more information on reputation check this (ancient) thread where it was discussed in great detail :)

When you get a reputation boost that shows "Even" and has a grey box it means the person who gave the rep was not capable of raising or lowering your rep score (usually very new members).

Only green (positive) and red (negative) boxes next to the reputation attempt reflect in a change to your reputation level. The amount they reflect is determined by that particular user's ability to change reputation which is in turn (at least partially) determined by THEIR reputation.

Hope this helps :) Please mark as resolved if it resolves your issue.

Edit: After looking at both threads you linked and checking the reputation giver's profile they are both showing as "Newbie Poster" and more importantly showing:
Power to Affect Someone Else's Reputation Positively: 0 points
Power to Affect Someone Else's Reputation Negatively: 0 points
Edit 2: Had to add this lol... Also a person can only give reputation up to 10 times in a day if I read it properly which is likely why the rep boost I just received didn't actually affect me.

jonsca commented: You've gotten to know the site quickly! +0
TrustyTony commented: I should be able to boost your rep by one! +0
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

One option is to set the Format property to Custom and in the CustomFormat property enter MMMM/yyyy, then change the ShowUpDown property to true. This will give you a date in the format of "July / 2010" with the ability to select the month or year and use the up/down arrows to the right of the date to cycle by month or year from the current selection showing in the picker.

Alternately you can still set the custom format for the displayed date, unfortunately I am not sure how to get the drop-down calendar to default to the month setting instead of date setting.

Hope this helps :) Please mark as solved if it resolves your issue.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

The beauty of CSS is that a style/class can be applied repeatedly to different items. The additional beauty is you can define as many styles/classes as you want to.

That being said:

#button_a {
    display: block;
    background: url(rolloverimage.gif) top;
    width: 63px;
    height: 34px;
}

#button_a:hover {
    background: url(rolloverimage.gif) bottom;
    width: 63px;
    height: 34px;
}

#button_b {
    display: block;
    background: url(rolloverimage.gif) top;
    width: 63px;
    height: 34px;
}

#button_b:hover {
    background: url(rolloverimage.gif) bottom;
    width: 63px;
    height: 34px;
}

Can be utilized by simply assigning "class="button_a"" or "class="button_b"" as needed to assign different styles to different buttons.

Edit: or y'know take out the "_"'s and you should end up with a,b,etc button types, I may be reading the original wrong because it's way too warm here and my brain's melted :P

Hope this helps :) Please mark as solved if it resolves your issue.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Easiest way to do that... is to add a new DIV.

Make the new Div your tiled wave background and set the background color of your body to match the color you want to 'extend' below the wave tile.
CSS:

#BodyBG {
        margin-top: 0;
	background-color: #CCC;
}
#BG {
	margin-top: 0;
	background-repeat: repeat-x;
	background-image: url(imgs/bg_patt.png);
}
#Content {
	width:800px;
	margin-left:auto;
	margin-right:auto;
	padding: 0 0 0 0;
}

Page:

<style type="text/css">
<!--
@import url("resStyles.css");
-->
</style>
<body id="bodyBG">
<div id="BG">
<div id="Content">
--Your Centered Content Goes Here
</div>
</div>
</body>

Of course you need to change your import statement to match the name and location of your .css file and the background image URL to match your background tile.

The above should set your body background to #CCC which is a grey variant (set to whatever grey matches the bottom of your tile), set your first DIV to give your tiled background horizontally and set your second DIV to position your content cenrally on the page.

Hope this helps :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Definitely the more efficient method :)

As I said, I was just working from what was provided hehe.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Attached is a screenshot of what I'm mentioning here.

It doesn't happen for all ads (or maybe it's something that was changed in the ad-banner coding today) but with the specific ad in the attached image all of the menu drop-downs appear behind the advert and it is impossible to select anything below the first value of the drop-down as the menu loses it's mouse-over when the mouse passes over the advert.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

The problem is the "," within the number I believe.

A messy workaround (because I am sleepy due to the excessive heat here atm) would be the following:

string[] labelSplit = label_Start_Miles1.Text.Split(',');
string labelNew = "";
for (int a = 0; a < labelSplit.Length; a++)
{
    labelNew += labelSplit[a];
}
int32 newInt = Convert.ToInt32(labelNew);

That might work for you, at least I hope it does :) it should pull out all the commas in your numeric value allowing it to be converted. The only problem you might have from there is the decimal value, if there's anything to the right of the decimal it may want you to be using double or decimal instead of int.

Hope this helps :) Please mark as solved if it resolves your issue.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

I assume that what you are looking to do is put the phone number from the selected comboBox item into textBox1?

If so then you need to set up a SelectedIndexChanged event handler for the comboBox and in that event handler it should have an assignment of comboBox1.SelectedValue.ToString() to your textBox1.Text.

Something like this:

private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
    {
        textBox1.Text = comboBox1.SelectedValue.ToString();
    }

Otherwise, from what you're doing it almost looks as though you're trying to put EVERY value of the phone column of the data source into your textbox and you're selecting the string "phone" instead of selecting the actual value component of anything.

Hope this helps :) Please mark the thread solved if this resolves your issue.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

So ya, the only things that seem to be still... erm... "out of whack" are the solved thread count in the profile page (which you've already indicated is being worked on) and the subscription email notifications (which appear to no longer trigger at all, at least for me). Everything else from the user end (at least from what I can see) seems back to norm :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

I would handle it in the following way:

For your CSS stylesheet -

#bodyBG {
	margin-top: 0;
	background-repeat: repeat-x;
	background-image: url(imgs/bg_patt.png);
}
#Content {
	width:800px;
	margin-left:auto;
	margin-right:auto;
	padding: 0 0 0 0;
}

For your page -

<style type="text/css">
<!--
@import url("resStyles.css");
-->
</style>
<body id="bodyBG">
<div id="Content">
--Your Centered Content Goes Here
</div>
</body>

You can play with adding an additional background-image and background-repeat: repeat-y; to have a secondary background of sorts that will tile downwards with the length of your content inside the #Content class if you like as well.

The above code sample will basically tile horizontally your wave background while setting up a secondary div container of 800px width that 'floats' horizontally centered on the page depending on the width of the inside of the browser window displaying it.

Hope this helps :) Please mark as solved if this resolves your issue.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

This library entry at msdn.microsoft.com might get you closer to what you're looking for if you're looking for a graphical output based on your data. At the least it should get you closer to what you need even if you need to modify the sample method they provide to fit your needs.

Hope this helps :) Please mark as solved if it resolves your issue.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Best I can do for you is point you at this page where someone else seems to have discovered a solution to match your needs.

Hope this helps :) Please mark as solved if it resolves your issue.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster
char letter = Char.Parse("a");
char letterEnd = Char.Parse("z");
if (File.Exists(dupePathDir))
{
    newfile = fname + extension; // set newfile initial value to match original filename
    while (File.Exists(newfile)) // loop while newfile exists in directory
    {
        for (char i = letter; i < letterEnd; i++)
        {
            int appended = fname.IndexOf("_" + i.ToString()); // obtain first indexed position of _letter in the file name, gets -1 if none
            if ((appended != -1) //Determine if the file name contains "_a" or whichever letter is currently represented by variable "i"
            {
                fname = fname.remove(appended) + "_" + (i+1).ToString(); // remove current _letter and add next one up in it's place
                newfile = fname + extension; // add the extension and compare in (File.Exists(newfile)) to continue or break loop
            }
            else
            {
                fname = fname + "_" + i.ToString(); //add _letter
                newfile = fname + extension; // add the extension and compare in (File.Exists(newfile)) to continue or break loop
            }
        }
    }
}

I believe that this loop might better serve your needs. I assumed here that all of your specific variables have been declared elsewhere in your code (ie: fname, extension, etc).

Hope this helps, I really didn't take the time to set up a file reader and such to test it but the loop SHOULD get you to the right place.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Firstly, your question is very vague and I'm not 100% sure what it is you're looking for here.

I'm going to make the assumption that you are looking to dynamically populate "News" bulletins related to your site so that users can see the "News" bulletins at the top of a web-form you have on your site each time they go to that form. Is that correct?

If this is correct then there is a simple method of doing this. It will, however, require the following:

  • A data source (dataBase, XML file, etc) from which to draw the "news" information
  • A procedure (generally in the code-behind) to read the data source
  • A dynamically populated text area of some sort in the front end (label, read-only textbox, read only text area, etc)

The basic process here being that your data source is populated with the "news" information you would like displayed to your page's viewers. The (code-behind) procedure connects to the data source and retrieves the most recent "news" and updates the dynamic text on the front end of your page.

The exact methods for doing all of this, however, vary greatly depending on what data source you're using, what method you're using for determining the current "news" to display and what textual output type you're using on the front end.

If you could provide some additional information as to how you were planning to implement this, perhaps we could be of more assistance in …

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Just following up on the Reputation/Post Count/Etc. part of all of this, rep seems stable and correct (thank you :) ), post count seems stable and correct (thank you :) )...

The only thing seems to be off at the moment is that the profile page shows double the number of solved posts that hovering over a person's avatar would show (the latter being correct) but y'know... what with everything else that's happened I'm thinkin' I can live with that lol.

I'm hoping, if you had a chance to read it, my IM at least cheered you up through all of that craziness there cscgal :P

Edit: Email notification on subscribed threads seems a bit iffy at the moment as well but I actually don't mind the slow-down to the flooding of my inbox anyway lol

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

I don't believe XNA 3.1 is supported by VS 2010 at this time, in case you are interested in XNA development.

Not sure on the version but tools for XNA development are included in the VS Express for Windows Phone install package and are installed as Windows XNA Game Studio 4.0 so I would assume that some XNA is supported by VS2010 or it wouldn't be included in the express edition.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Confirming from my end that post count appears to be ok now :)

and
>>That's a bit like the message "keyboard undetected -- press any key to continue"

Only if you assume that someone who can't log in is also unable to read the posts (which I was able to do even at the beginning of the login issue earlier)... Granted, I'm sure newer members (which I assume is the subset that got hit by the table corruption) would not necessarily think to look in that segment of the forums to find the post about what was going wrong :)

To be honest I'm surprised at how quickly you guys managed to pull things back to "normal" around here considering the havock that a corrupted DB table can cause in many complex systems.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Rep is fine now for me so I'm assuming that much is fixed :)

And no need to apologize hehe, stuff happens and you just work to fix it as you can :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

About all I can help you with here is the {0} as it's just a placeholder for the URL component of the received httpRequest (the part consisting of www.domain.com).

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

I am curious. Did the database that went poof also store statistic information for the users as well?

It seems like my 'reputation' rating dropped by about 10 points along with a massive chunk of my post count and I'm just guessing that that information was (at least in part) contained within the same user table?

In either event, I'm just glad you guys are having some success in restoring order :) I was having DaniWeb withdrawal hehe

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

What you might want to consider is the following:

Disable the X close option for form 2 and instead put a button within the form that will perform the tasks of re-showing the first form and closing the 2nd.

Alternately, the FormClosing event SHOULD catch the close of the form and allow you to use the event handler to re-display the prior form with the possible exception being if the form you are closing is a modal dialog box as this is not disposed when the close is clicked but rather rendered hidden.

While I'm sure you've read it already this page has some resource information on the use of the formclosing event that may or may not help.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Ruh Roh... Methinks the server mice have gotten off their spinning wheels and started chewing on the databases... :-O

I'm just going to quietly "Solve" this thread and hope that puts those critters in a better mood and gets them back to spinning their wheels that make things run smoothly.