Fenrir() 52 Newbie Poster

Do you mean that you want the first half to be centered on top and then the second part below it to be left alinged?

this is a very simple example you can test for yourself. If indeed i'm understanding you correctly

richTextBox1.AppendText("Header");
richTextBox1.SelectionAlignment = HorizontalAlignment.Center;
richTextBox1.AppendText(System.Environment.NewLine);
richTextBox1.AppendText("First Line");
richTextBox1.SelectionAlignment = HorizontalAlignment.Left;
Fenrir() 52 Newbie Poster

Try this. (c as CheckedListBox).CheckedItems.Count

Fenrir() 52 Newbie Poster

Can't quite remember where i found this but it works like a charm.

Add the following method in your application

public IEnumerable<T> FindControls<T>(Control control) where T : Control
{
  var controls = control.Controls.Cast<Control>();

  return controls.SelectMany(ctrl => FindControls<T>(ctrl))
                                     .Concat(controls)
                                     .Where(c => c.GetType() == typeof(T)).Cast<T>();
}

Then you can call it as followed.

var t = FindControls<CheckedListBox>(this);

foreach(Control c in t)
{
  MessageBox.Show(c.Name);
}

This will for example bring back all the checklistboxes on the control you called the method with. Above the form is being passed in. this

ddanbe commented: Nice! +15
Fenrir() 52 Newbie Poster

You should be able to create a user control for this in the WPF side and then use an element host in your winforms application. Here is a nice link describing it Click Here. You'll probably need to take the plunge and sharpen up on your WPF though. even if it's just a little bit

Fenrir() 52 Newbie Poster

There might be a better way but i'm lazy so i loaded the image into the picturebox it ads the size mode and then i save and load the image from a temporary directory. Click Here this ensures that the sizemode is applied to the image

--Edit
this might be a better way actually Click Here you can resize the image on the fly in your base64 method and then save it to the stream

dhatsah commented: Thanks the second method was perfect. +0
Fenrir() 52 Newbie Poster

I would suggest you get the max emp ID from the database first and then increment it by whatever you need SELECT MAX(Emp_Id)+1 FROM Table

Fenrir() 52 Newbie Poster

Can you post the exact error you are receiving

Fenrir() 52 Newbie Poster

Sorry i was assuming you were using MS SQL here is the C# version

string test = "41521.880937(04.09.13 21:08:33)";
DateTime date = Convert.ToDateTime(test.Substring(test.IndexOf("(")+1, (test.IndexOf(")") - test.IndexOf("(")-1)).Replace(".","-"));

output : 4/9/2013 9:08:33 PM

Fenrir() 52 Newbie Poster

You can use some simple regex to achieve what you want but from past experience this can get quite verbose and inefficient i would suggest trying Click Here

Fenrir() 52 Newbie Poster

When you insert a breakpoint you can step your code. Highlight and rightclick the combobox you can then inspect the Value and Display members and check if they are correct.

Fenrir() 52 Newbie Poster

How are you sending the email? If the objects used to send the email are properly disposed in your code then you should have no problem deleteing the PDF

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

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

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.

Fenrir() 52 Newbie Poster

Click Here

You can try something like this

Surendrasinh commented: Thanks for reply.I know it.But i don't know that user will use which program whether he can use TeamViewer or any other Remote Program. +0
Fenrir() 52 Newbie Poster
using (System.IO.StreamWriter sw = new System.IO.StreamWriter("C:\\Logfile.txt", true))
{
  sw.Write("\r\nLog File : ");

  foreach (string file in System.IO.Directory.GetFiles(@"C:\\files"))
  {
    sw.WriteLine("File Name {0}", file);
  }

  sw.WriteLine("{0} {1}", DateTime.Now.ToLongTimeString(), DateTime.Now.ToLongDateString());

 }     

To get the format you need you have to get the file names within the loop and do the additional editing outside the loop.

Output :
Log File :
File Name C:\files\file 1.txt
File Name C:\files\file 2.txt
File Name C:\files\file 3.txt
File Name C:\files\file 4.txt
File Name C:\files\file 5.txt
2:50:20 PM Saturday, September 21, 2013

ddanbe commented: Nice answer +14
Fenrir() 52 Newbie Poster

Seems you copied that directly from your project summary :/

How about actually trying it first then asking for help..

Fenrir() 52 Newbie Poster

After creating the procedure just Execute it to return everything from "book".

EXEC booklist
Fenrir() 52 Newbie Poster

Maybe something along these lines rather?

SELECT (CASE WHEN COALESCE((EventSummary.[Event Information] - EventSummary.[Event Status]),0) = 0 THEN 'ACTIVE' ELSE (EventSummary.[Event Information] - EventSummary.[Event Status]) END) AS [Event Summary]
Fenrir() 52 Newbie Poster

Check out this link

http://msdn.microsoft.com/en-us/library/79b3xss3(v=vs.80).aspx

ddanbe commented: Good tip! +8
Fenrir() 52 Newbie Poster

Just type a9 no quotes

Fenrir() 52 Newbie Poster

From what i've read the normal textbox doesn't support links.

http://msdn.microsoft.com/en-us/library/f591a55w.aspx

try this