|
-
Jun 22nd, 2006, 11:47 AM
#1
Thread Starter
Addicted Member
-
Jun 22nd, 2006, 04:57 PM
#2
Re: My new program
1- I had to remove lots or resources from the Resources file because they didn't exist
2- After I first ran the App, it broke down when I tried setting my homepage/email
VB Code:
My.Computer.FileSystem.WriteAllText("c:\Program files\WeBrowz\homepage.txt", TextBox1.Text, False)
this line threw the exception, it's easy to figure out it's an IOException (DirectoryNotFoundException)
3- You can make the Close button default so I can press "Enter" instead of typing then going to my mouse or using Tabs
I hope this helps you
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Jun 22nd, 2006, 05:07 PM
#3
Re: My new program
I found some other design time errors (Problems):
1- When I maximized the "Source Grabber" window the "Source Grabber" check box and "Grab 'All Code" radio button appeared in the middle of the text
2-You could use some Source formatting in the source grabber
3- you really don't know how to use anchors (date and time display-er also)
4- Buttons in the "Image Grabber Tool" look totally different that any other button in the program
5- The "Print preview" doesn't work properly (Not all page content showed up) and it's not sizable
6- The "About" menu item must be under all other items in the Help menu (with a separator)
7- If your "Settings" doesn't have any sub items, move it to the Extras
8- The toolbar isn't well-formatted
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Jun 22nd, 2006, 06:01 PM
#4
Hyperactive Member
Re: My new program
ComputerJy is right....all of those are errors. And you should implement the use of Try Catch functions.
"Imagination is more important than knowledge" - Albert Einstein, born on March 14th 1879.
Can't find it here on VBForums? Go to the CodeProject. MSDN is your friend . I have such a bad website, my friend decided it would be funny to change the template and he moderates the site for me: visit my site!
"Thinking of you, wherever you are
We pray for our sorrows to end, and hope that our hearts will blend.
Now I will step forward to realize this wish.
And who knows, starting a new journey may not be so hard…
Or maybe it has already begun.
There are many worlds, but they share the same sky
one sky, one destiny..."
-
Jun 23rd, 2006, 12:55 AM
#5
Thread Starter
Addicted Member
-
Jun 23rd, 2006, 01:08 AM
#6
Thread Starter
Addicted Member
Re: My new program
..continuation
abotu the problem of the settings window breaking down, well i dont really know why because:
VB Code:
Private Sub settings_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim fileExists As Boolean
fileExists = My.Computer.FileSystem.FileExists("c:\Program files\WeBrowz\email.txt") And My.Computer.FileSystem.FileExists("c:\Program files\WeBrowz\homepage.txt")
If fileExists = True Then
Dim fileContents1 As String
fileContents1 = My.Computer.FileSystem.ReadAllText("c:\Program files\WeBrowz\email.txt")
TextBox2.Text = fileContents1
Dim filecontents2 As String
filecontents2 = My.Computer.FileSystem.ReadAllText("c:\Program files\WeBrowz\homepage.txt")
TextBox1.Text = filecontents2
Else
MsgBox("There is no homepage/email program file yet. Please fill one in", MsgBoxStyle.Information, "Critical Informaion")
End If
End Sub
as you can see-when the settings form loads, it checks if both the email and homepage files exist, if both exist then it loads their text into the textboxes...
also, is their any way(well i know their is i just do not now how to use it) of storing all the data of the program in a single file?
how do you mean that my toolbar is not well formatted??
lol gr8 thanks for your replies: as a prize you all get a free copy of the free program:WeBrowz v2.1(when it comes out) lol
cheers
patrick
-=PATRICK=-
Using Visual Basic .NET 2005
If you found a post useful then please Rate it!
Hidden DOS secret: add BUGS=OFF to your CONFIG.SYS
A program is a device used to convert data into error messages.
Programmer's Drinking Song: 99 programming bugs in the code/99 programing bugs/Fix one bug/compile it again/now there's 100 bugs in the code! (repeat until bugs==0)
All wiyht. Rho sritched mg kegtops awound?
-
Jun 23rd, 2006, 01:19 AM
#7
Thread Starter
Addicted Member
-
Jun 23rd, 2006, 07:11 AM
#8
Re: My new program
 Originally Posted by Gameunreal
for the forms: favourites, the three tools, and history:
instead of blocking the whole title bar, i will just block the close button...seems like a better idea....
could anyone tell me how to do that please
cheers
patrick
VB Code:
Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
e.Cancel = True 'This will cancel the close, you can
'minimize the form or hide, what ever you want
End Sub
as for your other question you can use:
VB Code:
Dim FS As New IO.FileStream("Data.ini", IO.FileMode.Append)
I just have a little comment, about something you didn't mention, Don't use full paths when saving files, only specify file name, unless you are %100 sure, the path exists
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Jun 23rd, 2006, 10:42 AM
#9
Thread Starter
Addicted Member
-
Jun 23rd, 2006, 12:20 PM
#10
Re: My new program
 Originally Posted by Gameunreal
thanks for your quick reply
how exactly do i impelement this? i need to store 6 favourite addresses(possibly more in version 2.1) and homepage setting, email setting and search setting.
sorry but... i really am not a pro at vb
cheers
patrick 
If you have lots of things to save, you should consider using a Database. it saves time and space.
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Jun 23rd, 2006, 12:35 PM
#11
Thread Starter
Addicted Member
-
Jun 23rd, 2006, 12:45 PM
#12
Re: My new program
You can use serialization, it's easy to use
here's a code sample that might help you:
VB Code:
Imports System.Runtime.Serialization.Formatters.Binary
Imports System.IO
<Serializable()> Public Class Class2
Implements IDisposable
Private Favorites As ArrayList
Private HomePage As String
Private EmilAddress As String
Private SearchSettings As String
<NonSerialized()> Private Const FILE_NAME As String = "Settings.bin"
Public Sub New()
Dim Str As Stream = File.OpenRead(FILE_NAME)
Dim des As New BinaryFormatter
With CType(des.Deserialize(Str), Class2)
Me.EmilAddress = .EmilAddress
Me.Favorites = .Favorites
Me.HomePage = .HomePage
Me.SearchSettings = .SearchSettings
End With
Str.Close()
End Sub
Public Sub Dispose() Implements System.IDisposable.Dispose
Dim Str As Stream = File.OpenWrite(FILE_NAME)
Dim Ser As New BinaryFormatter
Ser.Serialize(Str, Me)
Str.Close()
End Sub
End Class
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Jun 23rd, 2006, 12:49 PM
#13
Thread Starter
Addicted Member
-
Jun 23rd, 2006, 12:59 PM
#14
Re: My new program
VB Code:
Private Settings As Class2
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Settings = New Class2
With Settings
'Use stored values
End With
End Sub
Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
Settings.Dispose()
End Sub
You also must add some accessible properties from outside the settings class or as I call it Class2 
VB Code:
Public Property Home() As String
Get
Return HomePage
End Get
Set(ByVal Value As String)
HomePage = Value
End Set
End Property
Public Property Email() As String
Get
Return EmilAddress
End Get
Set(ByVal Value As String)
EmilAddress = Value
End Set
End Property
Public Property Search() As String
Get
Return SearchSettings
End Get
Set(ByVal Value As String)
SearchSettings = Value
End Set
End Property
Public Property Favourites() As ArrayList
Get
Return Favorites
End Get
Set(ByVal Value As ArrayList)
Favorites = Value
End Set
End Property
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Jun 23rd, 2006, 01:02 PM
#15
Thread Starter
Addicted Member
-
Jun 23rd, 2006, 04:06 PM
#16
Re: My new program
Of course not
Class2 is a separate class, but if you want to nest it within the form...errr...you can do that no problem
but you have to put the properties in Class2 and the Form_Load & Form_Closing in the main Form (Browser)
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Jun 23rd, 2006, 07:42 PM
#17
Hyperactive Member
Re: My new program
Actually do you need to make the files? Like favorite files? I can show you a way in the application where you do not need to save the favorite files but still have favorites every time you open up the web browser. Try my web browser: http://www.freewebs.com/tegadigital/...dssoftware.htm. The Xuastegui 3.6 (weird name) is the web browser. This browser implements what I just said. It has its own favorites and it will get them from a setting at runtime. Respond back or just PM me if you want details.
"Imagination is more important than knowledge" - Albert Einstein, born on March 14th 1879.
Can't find it here on VBForums? Go to the CodeProject. MSDN is your friend . I have such a bad website, my friend decided it would be funny to change the template and he moderates the site for me: visit my site!
"Thinking of you, wherever you are
We pray for our sorrows to end, and hope that our hearts will blend.
Now I will step forward to realize this wish.
And who knows, starting a new journey may not be so hard…
Or maybe it has already begun.
There are many worlds, but they share the same sky
one sky, one destiny..."
-
Jun 24th, 2006, 10:54 AM
#18
Thread Starter
Addicted Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|