Forms :: Reading .ini And Showing Settings?

May 6, 2009

I've been trying to get my head round a problem for days now, I want to read 'File.ini' line by line checking if specific text exists in the file and then display on a windows form weather particular settings are turned on or off.

So far this code works if "TargetText" exists but if it doenst I get an error on the code line: "If line.Contains("TargetText") Then".

[Code]...

It works if "TargetText" existin in a line in the file but if it doesnt exist I get the 'Null Reference Exception. Object reference not set to an instance of an object.' Any suggestions greatfully recieved!

View 3 Replies


ADVERTISEMENT

File I/O And Registry :: Reading .ini And Showing Settings?

May 6, 2009

I want to read 'File.ini' line by line checking if specific text exists in the file and then display on a windows form weather particular settings are turned on or off.So far this code works if "TargetText" exists but if it doenst I get an error on the code line: "If line.Contains("TargetText") Then".

Code:

Using z As System.IO.StreamReader = New System.IO.StreamReader(File.ini")
Dim line As String
' Read first line.

[code]....

It works if "TargetText" exists in a line in the file but if it doesnt exist I get the 'Null Reference Exception. Object reference not set to an instance of an object.'

View 4 Replies

Reading And Writing To Settings.cfg?

Jan 15, 2009

i want my form to read a textfile and make it like line 1 will put in textbox1.text and line 2 will put it in like textbox2.text and like when the app closes it writes textbox1.text to line 1 and textbox2.text to line 2 in the .cfg file

i found acouple codes, but i havent found one that worked for what i wanted to do

View 3 Replies

2010 Reading Configuration Settings?

Aug 23, 2011

Coding in VB.net in VS 2010. I have:Imports System.Configuration and I added a reference to System.Configuration.

When
**MsgBox(ConfigurationManager.AppSettings("sDBName").ToString)**

[code]....

View 2 Replies

LINQ: Writing And Reading XML Settings?

Mar 8, 2012

i am having trouble reading my XML settings. I Create new entries like this

Private Sub Create()
Dim doc As New XDocument
If File.Exists("Settings.xml") Then
doc = XDocument.Load("Settings.xml")

[code]....

The XML file will have multiple <Network> Entrys. I cant figure out how to loop the file and get every <Server> entry. But then if i opened a form and gave the variable one of the server entries how could i get that <Network> based on the server entries child parameters.

View 10 Replies

Reading And Writing Various User Settings?

May 18, 2011

I'd like to know if there's a better way to read/write various user settings to disk. My program loads up a bunch of settings during load but also during execution from a few different forms, encrypted string values, boolean values, different types. The code seems to work okay but I have a feeling it's just not the best way to be doing this. Some of the settings are encrypted strings that have to be decrypted/encrypted so the code to read/write the text file is a bit different on some items. The data read from disk usually goes to a public string, a textbox, or a up/down type control. Below is about 1/10th of the settings that get loaded/written at various times. Anyone have a better way that might be more efficient that I should look at?

[Code]...

View 2 Replies

VS 2008 Saving And Reading User Settings?

Feb 16, 2010

I need to save some string settings at runtime and read them back. They will need to be changed at anytime during runtime also. The examples I have found says they are obsolete for vs2008. how to save and read some string settings? I found alot for the application settings that to me are ones you set once for the app like in an asp.net site. I need to change these anytime like you would in a registry.

View 10 Replies

Forms :: Sharing Settings XML Document Between Forms?

Dec 26, 2009

I have an application built that has several forms. I use an XML file to store settings data (mainly folder names for data output) and I need each form to be able to access and modify the data. I'd also like each form to access functions from a main form (such as file parsing functions). I have read articles about properties and inheritance but I need some guidance as this topic is pretty confusing.

[Code]...

View 10 Replies

Forms Not Showing Up

Jan 2, 2010

I have built an application where there is a MDI parent form and other forms which i have not declared as Child forms but have set these forms not to show in Taskbar. While the application is running, if i have any of these forms open and i switch over to any other application other than this and when i come back to it, all these forms hide. I cannot reopen it or see it anymore.. Why is this happening?? how can i sustain these forms as it is even when i leave the application.LuxCoder

View 9 Replies

MDI And Showing Forms

Feb 23, 2012

I have added a MDI parent to my application and assigned all new forms to it (i.e. Form1.MDIparent = myMDI). When i hide and then show a form, it loses all of the data previously typed in the textboxes.

View 3 Replies

Forms :: Showing A SQL Result

Aug 18, 2010

I have the following code in my project:

Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim connectionString As String

[Code]....

I'm needing to do is to show in my messagebox.show the date from the sql query that I ran before this. I know that I havent declared a variable in that statement but I'm having a bit of a lapse today and was just wondering how to show that result in my messagebox.show.

View 19 Replies

Showing And Hiding Forms

May 4, 2010

When my login screen loads, if the user has not created an account the form will close and a form to create an account will appear. However when I code this both forms stay visible, instead of just the one. Where am I going wrong?[code...]

View 6 Replies

Showing And Hiding Forms In VB?

Mar 11, 2009

I've just upgraded from Visual Basic 6 to Visual Basic 2008 Express Edition.

1. Show anothor form (ie. Form2)

2. Close Form1.

At present when I use the me.form1 , but both Form1 and Form2 both closes.I would like to press a button or on a timer, to show Form2, while closing Form1.

View 4 Replies

Showing Forms From Another Thread?

Jun 20, 2009

my scenario is this: I have two forms and a module. Let's call one of the forms MainForm and the other SecondForm. My module is running on a seperate thread to MainForm. A sub routine is triggered in the module, and I want it to display SecondForm.

I understand that I cannot do this directly because SecondForm needs to be called from the UI thread, which is shared by MainForm. How would I go about doing this? I'm guessing that I would have to use a combination of invocation and calls to MainForm to activate SecondForm.

View 1 Replies

VS 2010 No Forms Are Showing Up?

Jun 30, 2011

Well I accidently double clicked both of my forms in a project and then they weren't pinned anymore so I exited them out hoping they'd be pinned aghain, but now when I open the project, no forms show up. Just blank blue wall... How can I get the forms back?

View 3 Replies

Data Not Showing In Window Forms App

Oct 1, 2010

I am just learning vb.net using vs 2008. I have a small forms app which I have conected to a small, single table 2 column database. I enter some numbers into a text box, press a button and the data gets entered into the dbase. However the only data that gets displayed in the data table I have on my form is the existing data.No new data entered is shown until I close down and restart the app. I have tried many times using statements such as [code]...

View 9 Replies

Difference Between The Following Methods Of Showing Forms?

Jul 26, 2011

What is the difference between the following two statements (in terms of memory management):

Dim frm as New MyForm()
frm.Show()
VS
MyForm.Show()

I am originally a C# developer, how does the second one make sense or even compile for that matter in VB.NET? (Show() is not a Shared/Static method) What is happening in the second case?

View 1 Replies

Forms :: Showing Both A Start And End Date

Sep 28, 2010

I have the following

[Code]...

and as you can see, I am showing users the next available date open to them is determined with the value dteReturnValue.ToShortDateString .. but what I'd like to do is show the user both the start date and the end date, which will always be +7 days from the field in my database.

View 5 Replies

Inherited Forms Not Showing In Designer

Jun 4, 2011

When I create an inherited form, after creation for some reason I cant see the form to edit in designer, I mean I cant drag and drop buttons, labels or any control to it since I just CANT see it, I have included a pic of what I see below where Form1 is the Inherited Form. What Am I doing wrong or what is happening

View 6 Replies

Showing Windows Forms From DLLs?

Oct 2, 2010

I'm trying to show a Windows Form from a DLL file - it's added to the application's refrences But I can't call the Windows Form from the DLL, I tried to make a function that shows the form but when I try to call that function in my application it says: Reference to a non-shared member requires an object reference How can I show the form? I'm tried to use this method: (it's in the DLL's form)

Public Sub Open()
Dim Instance As Windows.Forms.Control = Me
Instance.Show()
End Sub

View 3 Replies

VS 2005 Showing Another Forms Using Showdialog?

Apr 27, 2009

I make a program upon sending emails to my friends using smtp. The problem is that I have confusions why my another form will not show until it is not finished sending all of the messages. I want my next form to show how many percent were finished but the problem is that my form will show only until all the emails are sent on my listbox. I put my code on the load event of the for

View 5 Replies

VS 2010 Hiding/Showing Forms In MDI?

Feb 16, 2012

I am using a MDI parent to house each of the forms in my application. I have a main form and 2 sub forms. The sub forms are opened using the code below. Also, when I am finished entering info into these forms, i am hiding them so that I can reopen them with the same info still entered.

The problem is that when i show the form again, it is blank. Why would this be the case? I am never closing or disposing the form, so shouldn't it just unhide easily?Showing the sub-form(savingsfrm1) and and hiding the main form(riskfrm1)Public savingsfrm1 As Savings

Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

[Code]...

View 1 Replies

Forms :: DataGridView Display - Hiding And Showing

Mar 31, 2009

I have a form e.g. Form1 , which displays a datagridview.
1) On form load, the datagridview doesn't have any data
2) The user clicks on a button called filter, this opens a form where the user can specify parameters to filter the data by
3) This form calls a setData() in Form1, which fills the dataset with the data

This works fine. If I click on a button called controlPanel it launches another form and hides this. E.g.
dim cp as new ControlPanel()
this.hide()
cp.show()

On the controlpanel I have a button that links to form1. If I click on it. E.g.
dim frm as new Form1()
this.hide()
frm.show()
It redisplays Form1 but without any data in the datagridview.

I think the problem is that since I am creating a new instance for Form1 it comes up with the blank Form1. Is there a way to redisplay Form1 so that it retains the data that was displayed last, without having to retrieve the data from the database.

View 1 Replies

Forms :: TextBox Showing 2 Table Fields?

Mar 15, 2010

Have anyone developed a textbox where it is possible to display 2 fields in the textbox. We want to be able to show ID + description in the same textbox. (When user enter the textbox description may go away and the user can enter an ID)

View 2 Replies

Forms :: Tooltip In Checkbox Not Showing Properly

May 6, 2009

I added a tooltip control in my form and set a tooltip for a checkbox. The tooltip shows fine until I check the checkbox... If I check the checkbox once and uncheck it, the tooltip never shows up when I hover the mouse over it... How to make the tooltip to show on mousehover no matter the checkbox is clicked or not?

View 3 Replies

VS 2010 - Showing Forms On Multithreaded Application

Apr 17, 2011

I've finally gotten multi-threading working on my application, but now I'm having trouble showing forms when I need to. I currently have three threads in my program: one for updating a textbox, one for transferring files, and one for displaying forms. Here's a snippet of code from my program:

[code]...

I'm getting the error: Control 'frmXCopy' accessed from a thread other than the thread it was created on. I know what this means, but I can't find a way to make the ShowForm Sub run off of the main application thread.

View 9 Replies

How Do Design Settings Forms

Sep 3, 2009

How do design settings forms

View 2 Replies

Way To Do Settings Once And Apply To Many Forms?

Jan 28, 2011

I'm working in VS 2008, on a windows application.I have many forms, and I'm in the process of redesigning the GUI.Is there anything that I can do to standard some of the placement of the controls. For example, I have a header for each page, at a certain size and location. Instead of going to each form, is there a way to do the settings once, and apply to many forms?

View 2 Replies

Forms :: Copy Multiple Files Showing Progress In Progressbar

Dec 5, 2010

So as it says in title i need to copy several files from one folder to another. But i dont need to copy folder with files. i need to copy several files to another folder..

And show progress in progressbar.. is there a way how to do it, cos i found only how to copy 1 file showing progress..

View 1 Replies

Showing Toolbars For Excel File In A Windows Forms Control

Apr 2, 2012

I'm showing an excel file in a WebBrowser control on my form, but it doesn't show any toolbars. The customers wants the ability to make changes in the control and save them, hence the need to show the standard toolbars.

I've tried many different things including:

For Each cb As CommandBar In xlApp.CommandBars
cb.Visible = True
Next
'and

[Code]....

how I can get toolbars to show in the WebBrowser control?

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved