Jump to content
Xtreme .Net Talk

whosyodaddy

Avatar/Signature
  • Posts

    84
  • Joined

  • Last visited

Everything posted by whosyodaddy

  1. Thanks, although whenever I click 'Pig Sticker' In the ComboBox, i get a debug error like so: The program runs and debugs, but whenever I click on that I get that error. Here is my code: Dim IMG As Image If NorseTechno.SelectedItem = "Pig Sticker" Then PictureBox1.Image = IMG IMG = Image.FromStream(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("ballista.ballista.jpg")) End If Thanks... please help!
  2. I get a Debug Error:
  3. Hmm... Does anybody not know or are they too lazy?:confused:
  4. what does it do?:confused:
  5. OMG OMG!!! LOL!! I had the same problem... about a month ago I got the book 'Visual Basic Step By Step 2003' and it kicks ! It comes with a CD with the E-Book and all the examples (20+). The book is VERY VERY easy to read and you go at your own pace. Im 3/4 done with the book. I think the book is 1,000 pages so it's big. Its worth your money, you won't regret it. It's made by an author who wrote more than 30 Books on Visual Basic, Word, Powerpoint, C, Java, Excell, etc. He is good author.:D
  6. Ok, I know how to download a update with a progress bar from a past post, although when it downloads a file, It downloads like a .dat or .ini to update your current program. Although how (what do you add) to make it know if it is a newer version or not. So If you click update, and there is no newer version it says "no new version" or something like that. Here is my code: Imports System Imports System.Net Imports System.IO Public Class Form1 Inherits System.Windows.Forms.Form #Region " Windows Form Designer generated code " Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call End Sub 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. Friend WithEvents pbrPercent As System.Windows.Forms.ProgressBar Friend WithEvents lblInfo As System.Windows.Forms.Label Friend WithEvents filesizeLabel As System.Windows.Forms.Label Friend WithEvents Timer As System.Windows.Forms.Timer Friend WithEvents Button1 As System.Windows.Forms.Button <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container() Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form1)) Me.pbrPercent = New System.Windows.Forms.ProgressBar() Me.lblInfo = New System.Windows.Forms.Label() Me.filesizeLabel = New System.Windows.Forms.Label() Me.Timer = New System.Windows.Forms.Timer(Me.components) Me.Button1 = New System.Windows.Forms.Button() Me.SuspendLayout() ' 'pbrPercent ' Me.pbrPercent.Location = New System.Drawing.Point(8, 72) Me.pbrPercent.Name = "pbrPercent" Me.pbrPercent.Size = New System.Drawing.Size(320, 20) Me.pbrPercent.TabIndex = 0 ' 'lblInfo ' Me.lblInfo.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.lblInfo.Location = New System.Drawing.Point(16, 16) Me.lblInfo.Name = "lblInfo" Me.lblInfo.Size = New System.Drawing.Size(176, 16) Me.lblInfo.TabIndex = 3 Me.lblInfo.Text = "Demo downloader" ' 'filesizeLabel ' Me.filesizeLabel.Font = New System.Drawing.Font("Arial", 6.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.filesizeLabel.ForeColor = System.Drawing.SystemColors.Highlight Me.filesizeLabel.Location = New System.Drawing.Point(16, 48) Me.filesizeLabel.Name = "filesizeLabel" Me.filesizeLabel.Size = New System.Drawing.Size(176, 16) Me.filesizeLabel.TabIndex = 4 ' 'Timer ' Me.Timer.Interval = 1000 ' 'Button1 ' Me.Button1.Location = New System.Drawing.Point(200, 8) Me.Button1.Name = "Button1" Me.Button1.Size = New System.Drawing.Size(128, 56) Me.Button1.TabIndex = 6 Me.Button1.Text = "Download!" ' 'Form1 ' Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Me.ClientSize = New System.Drawing.Size(338, 103) Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.Button1, Me.filesizeLabel, Me.lblInfo, Me.pbrPercent}) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) Me.MaximizeBox = False Me.MinimizeBox = False Me.Name = "Form1" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.TransparencyKey = System.Drawing.Color.Firebrick Me.ResumeLayout(False) End Sub #End Region Function DownloadFile(ByVal sURL As String, ByVal pProgress As ProgressBar, ByVal Filename As String) As Boolean Dim wRemote As System.Net.HttpWebRequest Dim URLReq As HttpWebRequest Dim URLRes As HttpWebResponse Dim bBuffer(999) As Byte Dim iBytesRead As Integer Try ' Reset the progress bar pProgress.Value = 0 ' Start the request for the file URLReq = HttpWebRequest.Create(sURL & Filename) ' Get a response from the Request the response will hold header ' information from the Request such as filesize URLRes = URLReq.GetResponse ' Open the filestream to write back to, open in create mode so even ' if the file exist write over it. Dim FileStreamer As New FileStream(Application.StartupPath & "\" & Filename, FileMode.Create) ' Start getting the data from the response buffer Dim IncomingData As Stream = URLReq.GetResponse.GetResponseStream ' Set the progress bars MAXIMUM to Content length in bytes pProgress.Maximum = URLRes.ContentLength ' Start loop ' Loop until there is nothing in the receive buffer Do ' Transfer all the current bytes from the respose buffer ' into a byte array and hold the byte count received in ' iBytesRead limit to a maximum 1000 bytes iBytesRead = IncomingData.Read(bBuffer, 0, 1000) ' Write all the bytes in the Byte array into the opened ' filestream FileStreamer.Write(bBuffer, 0, iBytesRead) ' Code to change the value of the progress bar. If pProgress.Value + iBytesRead <= pProgress.Maximum Then pProgress.Value += iBytesRead Else pProgress.Value = pProgress.Maximum End If ' Show the current count of KB downloaded KB = BYTES / 1024 filesizeLabel.Text = "Downloading " & CInt(pProgress.Value / 1024) & "kb of " & CInt(URLRes.ContentLength / 1024) & "kb" ' Let windows process any events Application.DoEvents() ' Loop if not all bytes have been downloaded Loop Until iBytesRead = 0 ' If for some strange reason the progress bar is not at its maximum ' value, make it. Can happen with small downloads! pProgress.Value = pProgress.Maximum ' Download done ' Close the Response and the File IncomingData.Close() FileStreamer.Close() ' if successful return true to show this Return True Catch ' if NOT successful return false to show this and show message ' box with the error MsgBox(Err.Description) Return False End Try End Function Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim DownloadURL As String = "http://www.xtremedotnettalk.com/images/" If DownloadFile(DownloadURL, pbrPercent, "logo.gif") Then MsgBox("FILE DOWNLOADED!!" & vbCrLf & "Check the \Bin folder to see the download") End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub End Class
  7. How do you make the picture box display a image that you imported in your project? I know this is how you do It for a certain image on your computer: If ComboBox1.SelectedItem = "Pig Sticker" Then PictureBox1.Image = System.Drawing.Image.FromFile("c:\folder\image.jpg") What do i put so that there is code PictureBox1.Image= And then there is the code for showing the image that is imported in your project. Thanks:D
  8. why is the CS before the tr in this code: sr = CStr(Label1.Text) (of course you don't have Label1.Text in your code)
  9. Cool, you'd do that for me? Thanks! :D
  10. well, you can do it the simple way. the simple way for ending your WHOLE project is this: end :D
  11. so, you guys, what should I do? I don't have visual basic 6 installed, and i don't own it. i need to convert it to .net though. the size of the project? as in space, the vbp is 2kb. all of the files needed combined are 96kb. It contains stuff like ListBox, Main Menu, and code and not that much else. How can I get teh Visual Basic 6 controlls? thanks
  12. you must have flash player installed on your machine. download it from macromedia.com. You also need Shockwave installed. get it at shockwave.com
  13. Ok, when I want to convert this Visual Basic 6 project to Visual Basic.NET 2003 project, I convert it, select the file, then when its converting i get this error: "Upgrade Failed: Exception occured: The reference component CommonDialog is missing a design time license" Please help me. I need this file to be converted to .Net. I searched everywhere for the answer but no luck. I spent at least 30 minutes on microsofts website viewing their articles. Would I have to reinstall VB? Thanks.
  14. erm.... can anybody help me? :confused:
  15. :D AWESOME GUYS!!!!!! thanks so much!!! ya'll the best!!! does anybody know the code for when a certain item in the listbox is selected and then a certain item in the combobox is selected, it changes certain text? i think i know the beggining of the code: If ListBox1.SelectedItem = "A" ComboBox1.SelectedItem="E" Then (what do i put here to change the strConvertedText = strConvertedText.Replace("A","B") in form1.vb under button1_click to strConvertedText = strConvertedText.Replace("A", "E") and then it saves it) End If Remember, all of that code is in Form2.vb. So the user goes to Form2.vb Set's the settings that changes the code in Form1.vb, saves it, so when he goes back to Form1.vb, the code is saved. and the "a" replaces with "e"? does anybody know how to do this? i can give you the program if you want..... thanks! i spent alot of my time trying to figure out how... and i came up with this: Dim Z As Form1 If ListBox1.SelectedItem = "A" & _ ComboBox1.SelectedItem = "E" Then Z.RichTextBox1.Text = Z.RichTextBox1.Text.Replace("A", "E") Z.RichTextBox2.Text = Z.RichTextBox1.Text End If although whenever i run it i get the error whenever i click on the "A" in the listbox. the error where it gives me the options "Break" & "Continue". what is wrong? thanks.
  16. when i do that, i type in "ABCD" click the button, and this what comes up "ZZFZ" in richtextbox2. what is wrong?
  17. ok here: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click RichTextBox2.Text = RichTextBox1.Text.Replace("A", "B") End Sub doesn't work. when i type in 'a' in richtextbox1, hit button, 'a' appears in richtextbox2.
  18. i found out how by myself... here is how: go to edit-> customize toolbox, then check shockwave flash and active x controlls, then you just drag it to your form, in the properties select where ur .swf is by typing the location in the "movie" slot. that way is the easiest way u will find. its the way that works for .net and 6 thanks for ur info too!
  19. The only reason kids get it easy is because they are more eager and excited to do the things than adults. A
  20. What age did you start programming (with visual basic.... or something related)? Well.... I'm 12 years old, Im halfway done reading "Visual Basic.NET 2003 Step by Step", and I can program O.K. with VB. I also know Photoshop 7.0 really well. And I know practically everything In Microsoft Frontpage 2000. Also, Macromedia Flash MX is another thing i am a *expert* at. I have months of experience with these programs. Next year I will be learning OpenGL (no joke). I take my time and effort for everything that I do. I hope eventually when I grow up these skills will do me good and look good on my resume :cool: . At school I know everything about computers (im a comp. geek;) ) people always ask me their questions. I have my own laptop, and I'm in the laptop program at my school. I use my laptop for everything in almost all my classes (except Honors math and P.E.), and have been for the last 2 years. So.... well... tell us your stories!!:)
  21. yea man that would be hella cool! anybody know where to start? how?:D
  22. yes, i too, need the answer. although does anybody have code so it like only downloads the certain file from a certain directory if it is a newer version of the program?
  23. hmmm, well when i do that, whatever text i put in richtextbox1, same goes to richtextbox2. it doesn't replace any letters for some reason:( whats wrong?
  24. thanks!!! so would i do like: On Button Click (the code for clicking button) RichTextBox1.Text = RichTextBox1.Text.Replace("A","B") Then here is the code for putting the text that got replaced into richtextbox2 ok thanks for the code again! but what is the code for putting the text that got replaced into richtextbox2?:confused:
  25. im sorta far in a program i am making. it is like a decoder where you type a message in the richtextbox, hit the button, and the message will appear decoded in a secret code in the other richtextbox. what is the code for when the user types in something in richtextbox1, and it knows to turn all the letter "a" in richtextbox1 to "z" 's .in richtextbox2 in the exact same format for instance: Data in Richtextbox1: ABCD ABCD A's turn into B's B's turn into D's C's turn into F's D's turn into Z's So hit the button, Then the data in Richtextbox2 is: BDFZ BDFZ please help me on this. i am excelling quite far and reading some books, none of which explain how to do this. thanks.
×
×
  • Create New...