Jump to content
Xtreme .Net Talk

whosyodaddy

Avatar/Signature
  • Posts

    84
  • Joined

  • Last visited

whosyodaddy's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Thanks for reply but I don't know how I would go about making it search for matching letters and splitting into arrays. Please help, thanks. BTW, this is in VB 2003.NET ~whosy
  2. It's been a while since I've done this stuff... but would it be possible to have a simple scrambler where let's say you type a certain text in the textbox (stesnu) and then hit a button or so and it can display possible words in another text box. So type in stesnu hit button then unscrambles the letters and displays possible words (sunset)? Is there already an app somebody made for source code I can use(where can I find it?)? I have a text file with a word in each line maybe it can use that as a data source. How would I go about doing this? Thanks. :) ~whosy
  3. Thanks for that. I'm looking into it right now, but it always starts out with the same two people at first when you launch the application. Why is that? :confused: Your program is fantastic. But yours opens a text file into a listbox, then haves two listbox's gather text randomly from that. The way i'm trying to do it is different -- making it so when you click on radiobox1 (in a group box) it loads it into a listbox. Here is my script so far: Dim sr As System.IO.StreamReader sr = System.IO.File.OpenText("srcnames.txt") Dim mNameArray As New ArrayList 'read into an array Dim x As String While sr.Peek <> -1 x = sr.ReadLine() mNameArray.Add(x) End While sr.Close() 'now you have everything in the array - get the upper bounds of the array Dim mCount As Integer = mNameArray.Count Dim Loc1 As Integer Dim Name1 As String Dim Name2 As String Loc1 = Int(Rnd() * mCount - 1) 'now do your RND Name1 = mNameArray(Loc1) 'get the 1rst name mNameArray.RemoveAt(Loc1) 'remove the name from the array Loc1 = Int(Rnd() * mCount - 1) 'looping through all 4 would be nice - but for the sake of example we wont Name2 = mNameArray(Loc1) 'get the 2nd name mNameArray.RemoveAt(Loc1) 'remove the name from the array ListBox1.Items.Add(Name1) 'add them to listbox1 ListBox2.Items.Add(Name2) 'add them to listbox2 The things in bold is what i don't understand. What does 'loc1' stand for? when they say '-1' after mCount what does that mean. What about '-2' after it? Thanks.
  4. it says 'srcnames' is not declared. same with when I add the rootspace name :( I even add quotations and the System.IO.File.OpenText doesn't work. But, when I do add quotations it solves the 'srcnames' is not declared problem. After trying many things, I think I know the problem. It is looking for the .txt file in where the project is saved (root folder) such as C:\My Projects\projectname\srcnames.txt. It isn't looking for it inside the project. I will try that, and can you give code to search for inside the project? Thanks. I really appreciate ALL of you guys help so far.
  5. Ahh.. yes I forgot about that. Thanks. It works. The only problem is the opening of the .txt file. This isn't working: Nor This:
  6. Alright, thanks decrypt, that works for the file and streamreader. Although, how would I go about adding to a listbox? And would I put this code for the radiobox? Thanks. For the file here is my code:
  7. Yes, the rootspacename is correct and embedded resource is correct. I already did this, sorry i didn't mention i had them. Any other ideas why it's not working?-
  8. wow! thanks man :D There is some problem with it. 'StreamReader' is not declared (what is it for?). And when you say 'File.TextOpen' the 'file' is not defined. there is no option 'file', for when I uploaded a txt file inside my document with names. How would I go about adding to a listbox? BTW, would I put the code for the radiobox?
  9. Thanks Man. :D But, I havn't worked with arrays (i'm pretty sure), nor text files (being the source) :o . If you can post code that would be of great help, or do something to make it easier for me to learn. Thanks. BTW, i'm using Visual Basic .NET 2003 ;)
  10. anybody? thanks.
  11. Hello. I uploaded an image inside my project. Whenever form1 loads i want the backround image to be the image i uploaded. Here is my code (in form1load)but it doesn't work: Dim Form As Form1 Dim Back As Image Back = Image.FromStream(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("SRC_Tournament_Randomizer.SRC_Logo.gif")) Form.BackgroundImage() = Back I get an error as so: "An unhandled exception of type 'System.NullReferenceException' occurred in SRC Tournament Randomizer.exe Additional information: Object reference not set to an instance of an object." Can somebody tell me why i'm getting this error? Thanks.
  12. it's not as easy as it sounds... can you give me code for it please? is what you are talking about it randomly draws 2 names from a text file and displays it in the listbox? i know how to randomly pick a number... CStr(Int(Rnd() * 10)) 'Pick The Numbers Randomly 1-10 ....but not randomly draw certain text (bill,joe,john,etc.)
  13. Hello. I am creating a program where you choose from the following radio boxes, '1v1,2v2,3v3,and 4v4', they are all in a group box. Now here comes the tricky part. Whenever I click, for example, 2v2 (radiobox2) i want there to be two Listboxes, and each Listbox displays two random names from a certain list, but each two cannot have the same name. :confused: For Example: I click on radiobox2. Each Listbox randomly displays two names from a given source. (names: jim, bob, alex, mark, dan, rob, pat) So, Listbox1 displays MARK and PAT (randomly) and Listbox2 displays JIM and DAN(randomly). As you see, both listbox's cannot have the same name. For instance, when they draw randomly Listbox1 and Listbox2 cannot both of mark, pat, dan, etc. If you guys think there is a better way to do what i'm thinking (for instance, with something besides listbox's) please tell me. Any answer will be highly appreciated. :D
×
×
  • Create New...