
Celeron
Members-
Posts
21 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by Celeron
-
After much investigation into the subject of referencing my core to compiled scripts, I have been confronted with a simple loop which my code already included, however I was ignorant to it's purpose. For Each asm In AppDomain.CurrentDomain.GetAssemblies myCompilerParameters.ReferencedAssemblies.Add(asm.Location) Next
-
Put that code into the aforementioned button.
-
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim i As Integer Dim done As Boolean If Not ListView1.Items.Count = 0 Then Do Until done = True If ListView1.Items.Count = 1 Then If ListView1.Items(0).Selected Then ListView2.Items.Add(ListView1.Items(0).Text) ListView1.Items(0).Selected = False ListView1.Items.RemoveAt(0) done = True End If End If For i = 0 To ListView1.Items.Count - 1 If ListView1.Items(i).Selected = True Then ListView2.Items.Add(ListView1.Items(i).Text) ListView1.Items(i).Selected = False ListView1.Items.RemoveAt(i) Exit For End If done = True Next Loop End If End Sub This will move all selected items.
-
I have a script compiler similar to that outlined in Using .NET Languages to make your Application Scriptable thread. How would I allow the scripts access to functions inside my hardcoded source? For example, I have a console like application, and I want my scripts to be able to have a Console.WriteLine function which would have access to the hardcoded console.
-
I doubt you can change it via code, you'd be better off just making your own form and make your own MsgBox function to call it(with whatever sound you want of course)
-
Private Sub NotifyIcon1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles NotifyIcon1.Click Me.WindowState = FormWindowState.Normal Me.ShowInTaskbar = True NotifyIcon1.Visible = False End Sub Private Sub Form1_SizeChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.SizeChanged If Me.WindowState = FormWindowState.Minimized Then Me.ShowInTaskbar = False NotifyIcon1.Visible = True End If End Sub
-
If there is only 1 item, try using ListBox1.Items.Clear()
-
Simply a public HasChanged boolean that is set to True everytime certain fields are changed and False during save. You've got the right idea. Unfortunately, you'll have to go into every input control and tell HasChanged to be True when something has changed. Use handles to get this done quickly.
-
Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing e.Cancel = True End Sub This will not allow you to close the form at all, unless you use the End keyword or create a special function that is called from Form1_Closing.
-
User submitted guides/tutorials
Celeron replied to Celeron's topic in Suggestions, Bugs, and Comments
That is reasonable, it just seemed like those forums were for moderators/veteran users, and I didn't see anything that said otherwise. Thanks for clearing it up -
User submitted guides/tutorials
Celeron replied to Celeron's topic in Suggestions, Bugs, and Comments
Yes, I have seen those forums. However, when I try New Topic(or reply), I get: Celeron, you do not have permission to access this page. This could be due to one of several reasons: Your user account may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system? If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation. Maybe this is an error and my request is moot all-together :) -
A forum for user submitted guides would be convenient. It might create extra work moving posts that were in the wrong place, but I think users who aren't inclined to throw together websites could use this as an outlet for their urges to mentor the community. Not too important, just a suggestion.
-
MDI Child form cannot open other MDI Child form
Celeron replied to EricDotNet's topic in Windows Forms
childForm.MdiParent = Me.MdiParent ? -
MDI Child form cannot open other MDI Child form
Celeron replied to EricDotNet's topic in Windows Forms
Create a global variable in a Module, at the beginning of your program, have that variable be a reference to frmMain frm = frmMain Then from the child forums, just use frm(the global reference to frmMain) to create new MDI children. -
If I were doing that, I would generate some random numbers beforehand with Random Number class and then call all rows with ID's of those random numbers.
-
The shininess overuse of chrome is annoying and the game premise is rather confusing. However it is a great start, very well done, especially from scratch and by yourself.
-
Dim sr As New StreamReader(TextBox2.Text)
-
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim strFile As String = "file.txt" lstBox.Items.Add(strFile & " has " & GetLineAmount(strFile) & " lines.") End Sub Public Function GetLineAmount(ByVal file As String) As Integer Dim streamReader As New IO.StreamReader(file) Dim text As String = streamReader.ReadToEnd streamReader.Close() Dim lines() As String = Split(text, Environment.NewLine) Return lines.GetUpperBound(0) - 1 End Function May or may not be helpful. File paths have to be absolute, otherwise they are relative to the executable. By calling just "file.txt", it will assume "file.txt" is in the same directory as the .exe file that your program is running from. That is a relative filepath.
-
Public Sub Alphabetize(ByVal file As String) Dim streamReader As New IO.StreamReader(file) Dim text As String = streamReader.ReadToEnd streamReader.Close() Dim line As String Dim lines() As String = Split(text, Environment.NewLine) lines.Sort(lines) Dim streamWriter As New IO.StreamWriter(file) For Each line In lines streamWriter.WriteLine(line) Next streamWriter.Close() End Sub Basically what mutant said.
-
TCPClient has a bit more overhead than the Socket class, and in few cases, is more buggy. I've always prefered using Socket.
-
I don't have the same problem, using VB.NET and VS.NET 2003 AxWebBrowser.Document.all("fieldname").value = Value However, if you are continuing to have problems, there is another option. I'm going to assume you are trying to POST data, since that requires a more advanced function. Create a new System.Net.WebClient object. Public Class MyWebClient Public Client As New System.Net.WebClient Public Function HTTPRequest(ByVal URL As String, ByVal postString As String, Optional ByVal Method As String = "POST") As String Dim serverResponse() As Byte Dim postBytes As Byte() = System.Text.Encoding.ASCII.GetBytes(postString) Try serverResponse = Me.Client.UploadData(URL, Method, postBytes) ' Gets data from server! Catch ex As Exception MsgBox(ex.Message, MsgBoxStyle.Critical, ex.Source & " Error") Exit Function End Try Dim responseHTML As String = (System.Text.Encoding.ASCII.GetString(serverResponse)) ' Turns server response(in bytes) into a string(HTML) Return responseHTML End Function End Class postString are your field arguments, the format for postString is as such "fieldname=value&fieldname2=value2&ect=ect&ect=ect"