Fenrir() 52 Newbie Poster

Are you getting errors? or is the application just not running?

Fenrir() 52 Newbie Poster

You question is very unclear. Please try and clarify your question.. Have you tried any code yourself?

Fenrir() 52 Newbie Poster

When you step the code and hover on gridTest.Visibility what does the current visibility show?

Fenrir() 52 Newbie Poster

It means that your application is trying to login to sql and retrieve the data. but it's being prompted for a username and password. You need to specify this in your connection string for cn.

Fenrir() 52 Newbie Poster

Have a look at this article and the links provided Click Here Seems the easiest way is using registry values.

If you can retrieve the version then you can just build a custom string for the connection.

Fenrir() 52 Newbie Poster

If you can find out where office stores its theme data you can probably right some code around that. as for the actual theme in your application you'll probably have to use 3rd party software.

Fenrir() 52 Newbie Poster

Are they going inside the statements? Is the velocity and camera being set to 0? and if not then why is if (dir == dirUp) failing if it's suppose to succeed. What do you expect dir and dirup to be in this instance and what are the actual values when stepping the code? and when you step the code and press F5 until you reach the last iteration implying that you are on the "Last bad tile" what are the values then? and why is it succeeding

Fenrir() 52 Newbie Poster

if (dir == dirUp) also add checks on each of these if statements. and make sure the values are updating. best way of checking why the velocity isn't being set to zero is to actually step the code and see why the checks are failing and only succeeding on the last bad tile.

Fenrir() 52 Newbie Poster

I would suggest you insert breakpoints in foreach (Rectangle badTile in core.badTiles) When you reach the last bad tile ensure that it is contained in core.badTiles by right clicking and adding a watch and inspecting the items. If it indeed does step the code and determine why it's passing the checks.

Regards

Fenrir() 52 Newbie Poster

for (int x = 0; x < width; x++) this line loops x amount of times inside you perform a check if ((Convert.ToInt32(tileNo[x])) == 1) so if it passes this check then it declares c and assigns the value 1. So every time the check is passed it assigns 1. You need to only increment the variable in this check and declare it outside the for loop.

Fenrir() 52 Newbie Poster

I don't see you using timepicker_im.Value.ToShortDateString(); ?

Fenrir() 52 Newbie Poster

Okay then my only suggestion is this

The code on this line isn't assigning y to the proper index
int y = cboweekdays.FindStringExact(DR["Day"].ToString());

If you step this line y = -1 correct?
and it should for instance be 2 the index of "FRIDAY"

So either "FRIDAY" had its index changed in some weird way or cboweekdays.FindStringExact is not locating "FRIDAY" in the collection (this is what i reckon)

Also try whilst stepping the code to Highlight the combox and then click Add Watch. Break down into the combox until you find items and ensure that "FRIDAY" is contained in the collection at that point in code.

It's trying to match the string Exact so make sure that the value "FRIDAY" in the ComboBox and "FRIDAY" from DR["Day"].ToString() match in every sense of the word. And that there are no trailing whitespaces or anything along those lines. try using the text visualizer to accomplish this.

I have no further suggestions
Regards

Fenrir() 52 Newbie Poster

Okay so when you step your code what is the value of DR["Day"].ToString() when you add a watch

Fenrir() 52 Newbie Poster

Please note that FindStringExact matches case where FindString does not.

I think your only real problem is that (DR["Day"].ToString() is not matching the case. and in your click event you Specify "SATURDAY" so just try FindString instead and see if it works or DR["Day"].ToString().ToUpper()

Regards

Fenrir() 52 Newbie Poster

have you tried inserting a breakpoint and checking the values while the program is running?

Fenrir() 52 Newbie Poster

It's still the same Date and time that is saved into the database. So when you return the value from the database you can specify the format you need as you did above.

When saving the value to the database use the following.

dateTimePicker1.Value.ToString()
dateTimePicker1.Value.ToShortDateString()

Fenrir() 52 Newbie Poster

Short and Simple Thanks.

Fenrir() 52 Newbie Poster

So here's the thing and it's been quite simple up to here. I have never been required to do something like this and most tutorials are vague at best.

I have a Stackpanel with numerous children.
Each child then has a label and an image.

These were all dynamically created from a Dictionary.

I created an OnMouseEnter and OnMouseLeave for the Image. The problem i have now is when i enter the Image i want to alter the DropShadowEffect it already has assigned to it.

So for instance if the user were move over an image the DropShadowEffect will Enlarge and vice versa. I have no idea how to reference the Image from the Event i created for it.

Any help would be appreciated.

Regards

Fenrir() 52 Newbie Poster

You need to create a new thread. This ons is 4 years old and you're not contributing to it.

Fenrir() 52 Newbie Poster

Is this what you mean?

if (MessageBox.Show("record exist. do you want to continue?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
  //Do Something
}
else
{
  //Do something else
}
Fenrir() 52 Newbie Poster

You could use the TryParseExact method explained here Click Here

The easiest solution would however be just using the dateTimePicker as mentioned by grarhakim.

Fenrir() 52 Newbie Poster

Based on your question "How many search patterns exist" this is quite vague. seeing as there are just as many search patterns as there are file extensions.

When using something like an openFileDialog you specify the extensions you want to import based on your own personal preference.

Fenrir() 52 Newbie Poster

If the lines that contain filenames are unique you can use Regex to identify them. Otherwise you will have to create an exclusion list.

Fenrir() 52 Newbie Poster

Click Here

here is an excellent example. Only took 5 seconds to find :)

Fenrir() 52 Newbie Poster

So you only want to display {The information to display} ? Could you please specify exactly what type of layout you want to achieve withing the listview and where is tang2 assigned?

Fenrir() 52 Newbie Poster

Try implementing some exception handling in your code aswell. Also ensure that you have permission to access the appdata folder

Fenrir() 52 Newbie Poster

Based on your post about helping your "Friend" i'd say you're quite deep in the friendzone and this is your way of coping.

<M/> commented: burn :) +0
Fenrir() 52 Newbie Poster
        static void Main(string[] args)
        {
            double powValue = 0;
            double sqrtvalue = 0;
            int NumberOfValues = 9;

            for (int i = 1; i < 100000; i = (i * 10 + 1))
            {

                powValue = (Math.Pow(i, 2));
                Console.WriteLine(powValue.ToString().PadLeft(NumberOfValues));
            }

            powValue = Math.Pow(((Math.Sqrt(powValue) - 1) / 10), 2);
            for (double i = Math.Sqrt(powValue); i > 0; i = (i - 1) / 10)
            {
                sqrtvalue = Math.Pow(i, 2);
                Console.WriteLine(sqrtvalue.ToString().PadLeft(NumberOfValues));
            }

            Console.ReadKey();
        }

I left alot of room for improvement but i figured i won't have any hair left.

logic : 1^2 = 1
        11^2 = 121

    etc
ddanbe commented: NIce addition to this collection! +15
Fenrir() 52 Newbie Poster

You can try this Click Here

Regards

Fenrir() 52 Newbie Poster

Interesting seeing all of your comments. I am actually from south africa and everyone here basically forgot about mandela until he became sick and subsequently passed away I was born in the final stages of apartheid so it really didn't affect me but i can promise you that the country is heading away from mandela's vision. To me that is sad.

Fenrir() 52 Newbie Poster

Could you maybe post your code? Does it throw an exception when it stops in the middle?

Fenrir() 52 Newbie Poster
        private bool InObjectArea(MouseEventArgs e)
        {
            if (rect.Contains(cursor))
            {
                return true;
            }
            else
                return false;
        }

Seems this method isn't firing. Seeing as you created a new Rectangle object here. Correct me if i'm wrong

        public void RotateImage(Graphics pape,int rtangle)  // method 0, main method
        {
            pape.TranslateTransform(x_cor, y_cor);
            pape.RotateTransform(rtangle);
            paper.DrawRectangle(new Pen(Brushes.Blue), -(float)rect.Width / 2, -(float)rect.Height / 2, rec_width, rec_height);
            pape.ResetTransform();
        }

Regards

Fenrir() 52 Newbie Poster

Have you tried stepping the code and checking the variable values and determine why it's not working? Also i don't see you ever incrementing the Variable "K"

Fenrir() 52 Newbie Poster

I just gave you a hint. You will need to code the logic to set the panel location and the logic to determine if the edges of the panels have connected.

Google Moving objects programmatically and Collision detection or something similar.

Fenrir() 52 Newbie Poster

if the nodes are hardcoded. For instance there are 3 hardcoded nodes and you need to reference them and add childnodes to them you can simply do treeView1.Nodes[Index of the Hardcoded node [0]/[2]/[3] etc..].Nodes.Add("This will be your database value");

Regards

Fenrir() 52 Newbie Poster

This is just a suggestion. Drag 2 panels onto a blank form and set Panel1's Dock in the properties window to Left and Panel2's Dock to right. For visual purposes assing them both colors or add a border.

Next add a button and in the button click event add the following.

Panel1.Width++;
Panel2.Width++;

This will cause the two corresponding sides of the panels to move closer together.

This should help you get started.

For furure reference.. Remember that daniweb users are here to help you but not do the work for you.

Regards

Fenrir() 52 Newbie Poster

You will to decide when to call the check method or you might need to use a timer and assign the appropriate interval.

Fenrir() 52 Newbie Poster

Have you tried anything yet? This might point you in the right direction Click Here You need to loop all the tabpages and their richTextBoxes. If you want to change only "int" and "2" in the string "int a = 2" you will probably need to use something like regex to only find "int" preceding an "a" and a "2" succeeding an "=" character.

Fenrir() 52 Newbie Poster

You can try this

        private void button2_Click(object sender, EventArgs e)
        {
            foreach (RichTextBox richtext in tabControl1.TabPages[tabControl1.SelectedIndex].Controls)
            {
                MessageBox.Show(richtext.Text);
            }
        }

Or just change your code to

            int tabNum = tabControl1.SelectedIndex + 1;
            RichTextBox textBox = tabControl1.SelectedTab.Controls.Find(("New file " + tabNum), true).FirstOrDefault() as RichTextBox;
            //textBox.Focus();
            MessageBox.Show(textBox.Text);
            //textBox.Focus();

Such a small thing that's causing all the frustration

Fenrir() 52 Newbie Poster

Instead of using text boxes why dont you just use the datetimepicker from the toolbox? I used 2 datetimepickers on a form so they won't exist in your application unless you create them. As for dtDeparture date make sure you declare it somewhere where all your methods can access it if multiple methods use it. Try moving your variable declarations to the top of your method and set their values where they are declared now.

Fenrir() 52 Newbie Poster

Here's a quick test i created which you can work from.

    double TotalCost = 0;
    DateTime CheckinDate = dateTimePicker1.Value;
    DateTime CheckOutDate = dateTimePicker2.Value;

    while (CheckinDate.ToShortDateString() != CheckOutDate.ToShortDateString())
    {
      if (CheckinDate.DayOfWeek.ToString() == Day.Friday.ToString() || CheckinDate.DayOfWeek.ToString() == Day.Saturday.ToString())
      {
        TotalCost = TotalCost + 150;
      }
      else
      {
        TotalCost = TotalCost + 120;
      }
      CheckinDate = CheckinDate.AddDays(1);
     }

Hope this helps

Fenrir() 52 Newbie Poster

Sorry if this reply is a bit late but i was curious. I replicated the problem as you are only replacing a partial match. Check this out for a simple and effective solution Click Here

Fenrir() 52 Newbie Poster

There should be many errors.. It seems like a copy and paste.

simple errors in your code i can see

Lines 32, 43 .SubString Should be .Substring which is odd seeing as it's fine on line 21

Like ddanbe said we can't really help you without specific errors. And maybe some insight as to what your application does exactly.

Fenrir() 52 Newbie Poster

Have you tried doing any of it yourself?

Fenrir() 52 Newbie Poster

Click Here

And this.

Fenrir() 52 Newbie Poster

It doesn't matter what the process ID is in the above mentioned code. seeing as if a process is invoked the description of said process would still be skype and you'll check for that and block it.

Fenrir() 52 Newbie Poster

Read the first articles in this(C#) section

Fenrir() 52 Newbie Poster

Try this

int ProcessID = Convert.ToInt32(((ManagementBaseObject)e.NewEvent.Properties["TargetInstance"].Value)["ProcessID"]);
Process process = Process.GetProcessById(ProcessID);
Console.WriteLine(" Process Description : "+process.MainModule.FileVersionInfo.FileDescription);

I've tested it before and it seems to work fine. Maybe you can find an easier way

What problems are you experiencing with pool.ntp.org?

Fenrir() 52 Newbie Poster

You can use a switch statement.

Click Here

Fenrir() 52 Newbie Poster

try inserting a breakpoint on that line.

Breakpoint-> if (textboxusername.Text == Uname && textboxpwd.Text == PWord)

Then check the value of textboxusername.Text and Uname by right clicking and adding a quick watch. You can then copy the two values over to something like notepad and see if there are any significant differences.