|
It is just designer generated code, nothing special. But there you go.
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(login));
this.label1 = new System.Windows.Forms.Label();
this.btnLogin = new System.Windows.Forms.Button();
this.txtUsername = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.txtPassword = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.panel1 = new System.Windows.Forms.Panel();
this.cbTVmode = new System.Windows.Forms.CheckBox();
this.pbPartnerLogo = new System.Windows.Forms.PictureBox();
this.label6 = new System.Windows.Forms.Label();
this.cbWebSite = new System.Windows.Forms.ComboBox();
this.chAutoLogin = new System.Windows.Forms.CheckBox();
this.chRememberMe = new System.Windows.Forms.CheckBox();
this.panel2 = new System.Windows.Forms.Panel();
this.pictureBox3 = new System.Windows.Forms.PictureBox();
this.pictureBox2 = new System.Windows.Forms.PictureBox();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pbPartnerLogo)).BeginInit();
this.panel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
|
|
|
|
|
How do you load images into the Picture boxes that you are using?
For a correct approach, have a look here.Me, I'm dishonest. And a dishonest man you can always trust to be dishonest. Honestly. It's the honest ones you want to watch out for...
|
|
|
|
|
|
Thank you for your answer, but according to the link you've given I am doing it correctly.
|
|
|
|
|
Hi,
every WinForm app should have a try-catch around its Application.Run() statement; it would provide a safety net for all mishaps that could occur in the main form's construction. So try it like this:
public static void Main() {
try {
...
Application.Run(new Form1());
} catch(Exception exc) {
Console.WriteLine(exc.ToString());
}
}
That should give you the stack trace and point you straight at the problem.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
modified on Sunday, February 14, 2010 7:03 AM
|
|
|
|
|
Thanks, I will try it and let you know.
|
|
|
|
|
Hello every body,
I've developed a .NET C# application. I have a strang problem here, Some times while working in the application It stops suddenly with no error messages or any thing. I remember when I was in the debug mode , it did the same problem also and without error messages or exceptions.I cant recognize the time it stops (may be it is not fixed ?). The program do alot of things, it's mainly for scoreboards control but it uses .Net libraries for capturing videos from TV card, access a shared folder in the network and uses custome made controls (buttons ).
How can I know the reason of this problem ???All You Need Is A Good Friend
|
|
|
|
|
Goto to the Debug menu, open the Exceptions box and select all options in the "Break when an exception is" dialog.
Maybe that will allow you to see an error message in the application.Me, I'm dishonest. And a dishonest man you can always trust to be dishonest. Honestly. It's the honest ones you want to watch out for...
|
|
|
|
|
|
How can I convert the IPictureObject of MODI.Image.Picture to a "standard"
image (System.Drawing.Image or System.Drawing.Bitmap) in C#
thanks to allHAVE A GOOD TIME
|
|
|
|
|
Although I have never used IPictureObject , I can suggest if you can get the handle of the image, you can use Image.FromHBitmap method to convert it to an image object.
Hope this helps."No matter how many fish in the sea; it will be so empty without me." - From song "Without me" by Eminem
|
|
|
|
|
thanks.i change it , but not work HAVE A GOOD TIME
|
|
|
|
|
If you can post the code how you did that, may be someone familiar with the interface you are dealing with can help. "No matter how many fish in the sea; it will be so empty without me." - From song "Without me" by Eminem
|
|
|
|
|
thanks d@nish for your reply.sample program is paperless desktop in c# forum.link is here The Paperless Desktop[^]
i ask this question from martin but , i dont receive answer yetHAVE A GOOD TIME
|
|
|
|
|
Hi,
can any one please do et me know if we could insert an image into an xml if so please do let me know how.
my task is to read an image from .xml file and save it in to databae
|
|
|
|
|
Here is way to write images to an XML file:
Image image = Image.FromFile(@"image file path");
MemoryStream memStream = new MemoryStream();
image.Save(memStream, image.RawFormat);
byte[] array = memStream.ToArray();
string imageString = Convert.ToBase64String(array);
Now all you have to do is to write this string to the XML file.
In order to read the image from the string, you can use this:
string imageString = "read the image string from XML file";
byte[] imageBytes = Convert.FromBase64String(imageString);
MemoryStream memStream = new MemoryStream(imageBytes);
Image image = Image.FromStream(memStream);
Although, it would be better if you store image files at a location and just the path in the XML files. In case you are dealing with large images, you would have a very bulky XML file."No matter how many fish in the sea; it will be so empty without me." - From song "Without me" by Eminem
|
|
|
|
|
Hi Dinesh,
can i know how to insert an image in an xml file sice xml file consists of only tags can you please do send me the sample link if any to my mail so that i can make samples of it
|
|
|
|
|
He showedspoonfed you how to turn the image into an "xml-clean" string, surely you know how to insert a string into an xml file, otherwise how can you be using an xml file at all?
|
|
|
|
|
I already posted the code. What else are you looking for? "No matter how many fish in the sea; it will be so empty without me." - From song "Without me" by Eminem
|
|
|
|
|
I'm creating a series of controls that I need to draw myself.
They are all derived from Control and each overrides OnPaint().
The main parent control paints itself fine. It maintains a list of the second-level controls and they paint fine too. Each of these second-level controls contain their own lists of third-level controls, that ideally will draw themselves too but at the moment, OnPaint(), does not get called for them.
Seems strange that the other two classes are able to paint and this last one is not.
|
|
|
|
|
Forgive my newbie question. I am trying to learn C#. I have utterly confused myself in trying to restart a server console. I do not have the server start on this yet but it locks up every time I restart and I am not real sure way. It shutsdown ok but then never makes the check if the process has exited. Can anyone give me a nudge in the right direction? Thanks
public void restartserver(string serverrs, string serverloc)
{
Process p = Process.GetCurrentProcess();
Process[] servername = Process.GetProcessesByName(serverrs);
IntPtr serverHandle = FindWindow(null, serverloc);
if (serverHandle == IntPtr.Zero)
{
if (serverrs == "arcemu-world")
{
btnWorldStatus.Text = "World Server is not running";
}
else
{
btnLogonStatus.Text = "Logon Server is not running";
}
}
else
{
SetForegroundWindow(serverHandle);
SendKeys.SendWait("Shutdown{ENTER}");
FreeConsole();
bool mytrue = true;
while (mytrue)
{
if (p.HasExited)
{
mytrue = false;
if (serverrs == "arcemu-world")
{
btnWorldStatus.Text = "Closing....";
}
else
{
btnLogonStatus.Text = "Closing....";
}
}
}
}
}
|
|
|
|
|
Maybe This[^] will help you..
|
|
|
|
|
Thanks for your help. After taking a look at the information provided I got it.
|
|
|
|
|
Is it spinning inside the while loop while (mytrue)? Also how did you verify the server has shutdown?
|
|
|
|
|
1. You are checking if your current process has exited instead of checking if the process you are killing has exited or not.
2. You are not using the Process array you have created (in the code block posted). So why even retrieve it?
Following code might help you out:
Process[] processList = Process.GetProcessesByName("proccessName");
MessageBox.Show("Killing processes...");
try {
foreach (Process process in processList) {
process.Kill();
process.WaitForExit();
}
MessageBox.Show("Processes killed successfully.");
}
catch (Exception exception){
MessageBox.Show("Could not kill on of the processes.");
}
You can also use the other overload of WaitForExit and provide a suitable time out. In case you use that, then, after the call to the method, check if the process has exited and display the appropriate method if process is still running."No matter how many fish in the sea; it will be so empty without me." - From song "Without me" by Eminem
|
|
|
|
|
HELLO EVERYBODY,
I have a problem, I load a pdf in a webbrowser in Windows, in this event
string gcPthTMP = @"C:\TMP\";
string gcPthTrans = @"C:\TRANS\";
private void frmWebBrowser_Load(object sender, EventArgs e)
{
Uri uriPdf = new Uri(gcPthTMP + fileName);
this.webBrowser.Url = uriPdf;
}
This works fine, the problem is when I want to delete this file, i do:
private void frmWebBrowser_FormClosed(object sender, FormClosedEventArgs e)
{
this.webBrowser.Dispose();
this.Refresh();
System.Threading.Thread.Sleep(1000);
string fileName = this.txtUrl.Text.ToString().Trim();
this.Dispose(true);
if (System.IO.File.Exists(gcPthTMP + fileName))
{
System.IO.File.Delete(gcPthTMP + fileName);
}
}
this works fine in Vista, because delete the file without any problem, but the problem is in XP, this produce a error It says that the process is using by other process. Please help me, Ineed to solve this problem.
Thanks
|
|
|
|
|
why do you start a new thread?
why don't you reply to this[^]?
and why are you shouting the subject line?
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
|
|
|
|