hai you can try this out......... dim a as string a=textbox1.text File.AppendAllText("g:\text.text", a) File.AppendAllText("g:\text.text", Now.Date) File.AppendAllText("g:\text.text", " ) File.AppendAllText("g:\text.text", Now.DayOfWeek.ToString) plz reply if this solve your problem
Bhanwar Gupta
Posts
-
VB EE Read/Write to a text file -
Can visual studio work with a newer .Net Framework version?yes, i have tried it and vs.net 2003 is working with framework 2.0
-
find textbox in window formhi, what you can do with your problem is Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click,button2.click,button3.click,button4.click as on single click of this button you can control other buttons also. i think this can solve your problem:-D
-
Resizing Images in VB.Nethai there, i had made a project on wallpaper changer, and it is working very well. the code PictureBox6.Image = img5.GetThumbnailImage(117, 121, Nothing, Nothing) will made the picturebox as thumbnail of the size demanded. and if you wnat to make the size of the picture according to the resolution ofthe desktop than check this out.... private static void ConvertSourceFileToBmp(string sourceFilePath, string tempBmpFilePath, ScaleStyles scaleStyle, Color backColor) { Image sourceImg = Image.FromFile(sourceFilePath); if (scaleStyle != ScaleStyles.BestFit) { sourceImg.Save(tempBmpFilePath, System.Drawing.Imaging.ImageFormat.Bmp); } else { //get the dimensions of the screen float H = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height; float W = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width; //get the image dimensions float h = sourceImg.Height; float w = sourceImg.Width; //dimensions of target float targetHeight = -1; float targetWidth = -1; //find the appropriate height and width if (H / h >= W / w) { targetWidth = w; } else { targetHeight = h; } if (targetHeight == -1) { targetHeight = (H / W) * targetWidth; } if (targetWidth == -1) { targetWidth = (W / H) * targetHeight; } //create a new image with the default back color with the scaled dimensions w.r.t. image and screen Bitmap bmpImage = new Bitmap((int)targetWidth, (int)targetHeight); Graphics g = Graphics.FromImage(bmpImage); SolidBrush backgroundColorBrush = new SolidBrush(backColor); g.FillRectangle(backgroundColorBrush, 0, 0, bmpImage.Width, bmpImage.Height); //layout this image in the center g.DrawImage(sourceImg, Math.Abs(targetWidth-sourceImg.Width)/2, Math.Abs(targetHeight - sourceImg.Height)/2, sourceImg.Width, sourceImg.Height); //save it as bmp bmpImage.Save(tempBmpFilePath, System.Drawing.Imaging.ImageFormat.Bmp); //dispose stuff backgroundColorBrush.Dispose(); g.Dispose(); bmpImage.Dispose(); } sourceImg.Dispose(); } private static void SetReg