Jump to content
Xtreme .Net Talk

NK2000

Avatar/Signature
  • Posts

    166
  • Joined

  • Last visited

Everything posted by NK2000

  1. if you want to do it in that way then you have to add a parameter for the index like public void Add(string PhoneNumber, int index) { Customer.Phone[index].Text = PhoneNumber; }
  2. if making people happy is always that easy... :)
  3. text = text.Substring(0, text.Length-1) + "_";
  4. just a simple look in your vb.net code shows me the right vb.net syntax i think Dim Time as DateTime = DateTime.Now; While (Time.DayOfWeek <> DayOfWeek.Saturday) Time = Time.AddDays(-1) End While ' here output code..
  5. ah that is also a good method DateTime Time = new DateTime.Now; while (Time.DayOfWeek != DayOfWeek.Saturday) Time = Time.AddDays(-1); MessageBox.Show(String.Format("Last Saturday was on {0}", Time.ToString() )); This is c# code, if you cant translate it to vb.net then ask somebody else if he can help, sorry.. Explanation: First you get the current date and chick if it is a Saturday, if not then you just go back for day to day till it is a Saturday, if it is one then you got the date of the new saturday
  6. uhm Refresh is public so just call the Refresh method of the particular form
  7. i would do it in that way just get the current DateTime by DateTime.now then just get the current dayofweek of it, then you have to compare the dayofweek with an array to know how many days the last saturday is ago after you know the count of days just use the DateTime.AddDays(-CountOfDays) that should work i think
  8. after noticing that i forgot you and making the promise to code it, i noticed (again) that your code is in vb.net, which is a problem since i am coding in c# nevertheless i coded it in c# and hope you understand everything, if not just ask! using System; using System.IO; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; namespace ButtonBitmap { public class Form1 : System.Windows.Forms.Form { private string Filename = "ground.bmp"; private int X = 0; private int Y = 0; private int MaxX = 5; private int MaxY = 5; private Bitmap Tile = null; private Bitmap Map = null; private System.Windows.Forms.Button GroundBtn; private System.ComponentModel.Container components = null; public Form1() { InitializeComponent(); } protected override void Dispose( bool disposing ) { if( disposing ) { if (components != null) { components.Dispose(); } } base.Dispose( disposing ); } #region Windows Form Designer generated code /// <summary> /// Erforderliche Methode für die Designerunterstützung. /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. /// </summary> private void InitializeComponent() { this.GroundBtn = new System.Windows.Forms.Button(); this.SuspendLayout(); // // GroundBtn // this.GroundBtn.Location = new System.Drawing.Point(192, 32); this.GroundBtn.Name = "GroundBtn"; this.GroundBtn.Size = new System.Drawing.Size(88, 32); this.GroundBtn.TabIndex = 0; this.GroundBtn.Text = "Make Ground"; this.GroundBtn.Click += new System.EventHandler(this.GroundBtn_Click); // // Form1 // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(292, 273); this.Controls.AddRange(new System.Windows.Forms.Control[] { this.GroundBtn}); this.Name = "Form1"; this.Text = "Form1"; this.Paint += new System.Windows.Forms.PaintEventHandler(this.Form1_Paint); this.ResumeLayout(false); } #endregion [sTAThread] static void Main() { Application.Run(new Form1()); } private void GroundBtn_Click(object sender, System.EventArgs e) { if (Tile == null) //init { if (File.Exists(Filename)) { Tile = new Bitmap(Filename); Map = new Bitmap(Tile.Width*MaxX, Tile.Height*MaxY); } } if ((Tile != null) && (Map != null)) { Graphics g = Graphics.FromImage(Map); g.DrawImage(Tile,X*Tile.Width,Y*Tile.Height); // Preparation for next Image! ++X; if (X >= MaxX) { X = 0; ++Y; } if (Y >= MaxY) Y = 0; ((Control)sender).Parent.Refresh(); // Refreshing Form1 ! } } private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { if (Map != null) { e.Graphics.DrawImage(Map, ClientRectangle.X, ClientRectangle.Y); } } } } I also found out that you have a drawing problem if your app was hidden by another window ( which also leads to a OnPaint() )
  9. ups sorry i forgot you, i will code it now and send it in some minutes :)
  10. uhm maybe i havent enough experience for that, because i didnt work that much with forms, but why do you have to use a component, and not the control class (inherited from component) ?
  11. there was a thread about getting keys, even if a control has no focus, you need to use win32 callback/hook or DirectInput
  12. first we need to know if you mean start c# that you already know the syntax or that you start from nothing i recommend reading online tutorials about c# syntax or buying a book, since i am german, i dont know english resources currently, but would be no problem to find some, if you wish so
  13. maybe it helps to tell us what nunit is, maybe also typing of urls can help, there are people who take time to create good answers and try to get new knowledge all the time, so if you had posted here a link i would read it perhaps and give you an answer :)
  14. uhm i just would look in a xml and just create own ones with echo command if you say this is not so a good idea, i dont mind because i dont like xml that much, only at certain situations it is quite good..
  15. i totally agree, i try to start such a project, but i dont know if it will be successful, since i need help of people... so how will it work? i am going to setup an environment like php documentation where everybody can post comments, and then just slowly take the best out of the comments and fill the docu, any ideas, which could help?
  16. which prooves my idea to build an own one :)
  17. you get the user's ip by this: $_ENV["REMOTE_ADDR"]; just compare it with the server ip..so your client is definitly localhost :) i dont know what you mean by relayed xml, i thought this is like a normal php script which just echos the xml syntax, like it normally does with html so i thought you can just insert line breaks \n (maybe \r\n for win) so that you get more lines and can look at the xml syntax in an easier way
  18. oh this vb.... i just love c# (c-style) syntax :)
  19. why dont you load the data directly from mySQL? xml tells you the position of the error, just look at this position, do you use linebreaks ( '\n' ) ? because 1,469 looks like a really long line..and wont improve your bug finding.. so it looks that your php generates an xml error, maybe you just forget a char so that xml cant read the information at the current position
  20. dllimport attribute is the solution http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vcwlkSysimportAttributeTutorial.asp
  21. do you mean by even that it is dividable by 2? (english is not my native language) if yes then use this if (txtField.Length % 2) // code for even else // code for not even if i understood you wrong, then please tell me :)
  22. ah i think i understand you, what about building your own one? a treeview could be quite helpful here :)
  23. just a quite simple question, but thanks :) Windows also has some automatic position method where you can display it in the center of your screen, which is optimal for splash screens
  24. for that reason i dont use it that way i really prefer asynchronous server there is also an example in the msdn for that way
  25. "folder browser dialog box" what is that?
×
×
  • Create New...