|
Hey all,
Newbie question here that probably has a simple solution that I can't seem to find, but I'm new to programming and am still playing around.
What I'm trying to do, is create a program that will allow someone to enter data into a couple textboxes. What I want to happen is, to have a button that allows the user to "save" his/her entered data in these textboxes so that when they launch the program again, these changes are displayed until they are changed again. Can anyone give me some sample code that would accomplish this?
Any help or links to appropriate articles would be greatly appreciated.
Thanks!
Oh, forgot to mention that I'm using VB.Net 2003.
-- modified at 12:33 Wednesday 26th July, 2006
|
|
|
|
|
Hi, you can do this using the registry. Well thats what I did.
To save the settings to the registry you need this code
My.Computer.Registry.CurrentUser.CreateSubKey("name of your program")<br />
<br />
My.Computer.Registry.SetValue_("HKEY_CURRENT_USER\name of your program","textbox name", textbox name.Text)
To load the data back into the textbox you can use this.
textbox name.Text = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\program name", "textbox name", Nothing)
You need to put this code in a button or a timer and something like that.
Good luck
-- modified at 13:23 Wednesday 26th July, 2006
|
|
|
|
|
I'll give that a try. Thanks!
|
|
|
|
|
Just wanted to thank you again for the help. I got it to work properly, although using a slightly 'different' wording, i suppose. Your code was giving me some errors, so I looked for a couple of different ways of doing the same thing and this one ended up working for me.
My code ended up looking like this:
<br />
Dim CompSN_Reg As Microsoft.Win32.RegistryKey<br />
<br />
CompSN_Reg = Microsoft.Win32.Registry.CurrentUser.CreateSubKey("ACQ01")<br />
CompSN_Reg = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("ACQ01", True)<br />
CompSN_Reg = Microsoft.Win32.Registry.CurrentUser.CreateSubKey("ACQ01\\CompSN")<br />
CompSN_Reg.SetValue(txt_ACQ01_Comp_SN.Text, txt_ACQ01_Comp_SN.Text)<br />
Same idea in theory... but so fickle. Ahhh, I'm constantly reminded why I've always hated programming.
Anyways, Thanks!
|
|
|
|
|
Oh well, I don't mind. I'm quite new to VB.NET
Aaron
It might be because I use VB.NET 2005
-- modified at 17:44 Wednesday 26th July, 2006
|
|
|
|
|
Beside using the registry, you can use My.Settings to store your setting.
You have to create your setting in Design Time
You can set this in Project Properties and point to Settings Tab.
The settings will be save into XML format in your application path
here's the code to change and save the settings
----------------------------------------
My.Settings.UserName = "BrazenSix"
My.Settings.Subject = "About what??"
My.Settings.Save()
to retrieve settings value
----------------------------------------
Dim UName, USubject As String
UName = My.Settings.UserName
USubject = My.Settings.Subject
|
|
|
|
|
I cant find any sample code for Remote Desktop in Visual Studio 2005. Does anyone have some sample code to connect to a terminal server or know where I can find some? I have played around with the "Microsoft RDP Client Control", but have not been able to get it work correctly. I would like to be able to connect, change the screen size, etc.
|
|
|
|
|
I would like to know how to do this as well.
|
|
|
|
|
Have you typed in the IP address or host name in the server box in properties
You need to make the sure that the computer you are connecting to will accept RDP connections and the username you are going to use must have a password and be an administrator or have a password and be in the remote desktop group.
|
|
|
|
|
I want to create a program that will prompt a user for a windows user name and password that authenticates against active directory. Once authenticated I want them to only be able to access particular forms based on their group permissions in active directory. For instance once logged in if they are in the Telnet group they can access the telnet portion of the program if not then they get a generic error telling them to contact their system administrator. They way I see it working is that when they log in it also checks to see what groups they are in and stores it as a variable. Each form that they then access checks that variable and if that group is not listed then the user will not have access to that portion of the program.
Thanks for any and all help.
|
|
|
|
|
If you're using VB.NET or VB2005. Please spend your time to look at MSDN Help:
'My.'
From 'My' you can get a lot of information about security, Devices, etc..
|
|
|
|
|
I am new to programming in Visual Basic .Net and I am looking to create my first real program. The program will contain a telnet and Ftp portion that I want users to be able to start by clicking on an icon on the main form. I then want that form to run in the main form and still allow the user to start the another form by minimizing the current form. If anyone has worked with Photoshop, I want to basically allow two or more forms to run at the same time (just like you can have to photo projects open at the same time) and allow them to be started by click an icon on the main form. The biggest problem I have is being able to create Icons that appear on a form similar to the picture shown below. I have various icons that I can use in .ico and .png format. I also need the forms to be able to be minimized and still appear on the main form so it can be maximized later if needed. Hopefully I have included all the information needed.
Thanks
|
|
|
|
|
I would like to create a print function that will automatically put headers and footers on the document. This will be used to print out quotes to send to customers. The headers and footer will contain the company logo, address, etc, and needs to be in color. The body of the document will come from a text file that will be imported. I would like to also set a specific line that it should start at when it brings in the text file or prints it off. The way I see it working is that it uses Word objects to create the final document once all parts are put together.
|
|
|
|
|
That's good. What is your question?
Mike Lasseter
|
|
|
|
|
|
Bear in mind that if you use MS-Word to do this then your users will need to have MS-Word installed on their machine to print out.
Instead you could create the document template in code using the .NET PrintDocument class - I have written a couple of articles on this site that do that....
|
|
|
|
|
I would be more than willing to do that. Can you please send me a link to the article that most closely deals with this.
Thanks
|
|
|
|
|
There's an article at this site[^] and a newer version of the source code (with a rudimentary effort of a graphical designer) on VBForums[^]
|
|
|
|
|
Hello everyone,
Thank you for viewing my post.
I have a question regarding the Datatable.Select method.
I have a program that stores the tables from the database onto the users computer and keeps them in memory, to reduce trips to the database, and not binding my program to the database, to allow the user to make changes without affecting the data directly on the database. I need to populate a listview from the tables within the user's computer.
<br />
The query in my db is as follows:<br />
Me.lstCommodityPool.RowSource = <br />
"SELECT commodityId, tbl_Commodity.commodityName " & _<br />
" IIf(nz(commoditySerialNum,'')='','','(S/N:' & commoditySerialNum & ')') " & _<br />
" IIf(nz(commodityUnitNum,'')='','',' - ' & commodityUnitNum) " & _<br />
" IIf(nz(commodityCurrentLSD,'')='','',' - ' & commodityCurrentLSD) AS commodityName " & _<br />
" FROM tbl_Commodity " & _<br />
" where commodityId NOT IN (select quoteCommodityId from join_tbl_Quote_Commodity " & _<br />
" where quoteId=" & Nz(Me.txtQuoteNum) & _<br />
" and quoteRevisionId=" & Nz(Me.txtRevNum) & _<br />
") and companyId=" & Nz(Me.combCompany) & _<br />
" order by commodityName"<br />
The question I have is how can I recreate the condition, especially the "NOT IN" clause, using the tables on the users computer? Thank you
|
|
|
|
|
Hey all.. Im just here to find out what people think of my program. It has been written in VB6 and is a fully functional web server called Caedo HTTPd.
Supports everything from GZIP to PHP, and much more....
Its open source, part of source forge, and all i would like is feed back on it. I take all critisizim the same. If you post some thing bad about it, i will simply try to make that beter
alright, any who, you can find Caedo at : http://caedo.0web.org !
... remember http://caedo.0web.org
|
|
|
|
|
I couldn't find any category for crystal reports so I am writting here. Sorry for that.
In my report each row displays the maximum { Max(field) } value of a set of feilds using Max function. These rows are in each Group.
I want to display the sum of these row in the Group Header at the top of each group. The Sum() function doesnot allow me to do the sum of Max fields, so I am adding each row's value to a variable and displaying that variable in the Group Header.
Variable x;
x = x + Maxfield;
But it displays only the value of the first row.
Correct result:
Group 1 Total - 5 (Sum of 3 + 2)
Row#1....3
Row#2....2
My incorrect result:
Group 1 Total - 3 (First row value)
Row#1....3
Row#2....2
can anyone please help.
|
|
|
|
|
Your question is incomplete to me.
(which version of crystal reports are used. how many max values per group do u want to sum? )
Why dont u use the summary...
right click on the field to summarize and select insert>summary..
that will do the rest for u.
thanks
|
|
|
|
|
I use crystal reports with .net 2003.
When I use summary I do not see this calculated field for summing up. Thats is why I am using this programatic approach. If theres any other way then I'll be thankfull for that.
|
|
|
|
|
how can i access a microsoft access database that has been converted into sql by the upsizing wizard by coding in visual basic 2005 express?
|
|
|
|
|
I am encountering the 'black icon' issue when loading .ico files into an ImageList for use with a ListView. If I load the icons into the ImageList as design-time, and pull them out with
' Create icon from ImageList<br />
Public Function AssignIcon(ByVal ImgList As ImageList, ByVal indx As Int32)<br />
Dim objBitmap As Bitmap<br />
Dim objIcon As Icon<br />
objBitmap = New Bitmap(ImgList.Images(indx))<br />
objIcon = System.Drawing.Icon.FromHandle(objBitmap.GetHicon)<br />
Return objIcon<br />
End Function
the icons are visible but any transparency is replaced with black.
If I load the the ImageList at runtime, referencing icons which I've declared as embedded resources, with either:
Dim ico0 As New Icon(System.Reflection.Assembly.GetExecutingAssembly._<br />
GetManifestResourceStream("APKK.icnCD_16x16.ico"))<br />
ImgList.Images.Add(ico0)
or
Dim ico0 As New Icon(Me.GetType(), "icnCD_16x16.ico")<br />
ImgList.Images.Add(ico0)
ALL I get is black boxes.
Setting other icons without going through an imagelist (like me.icon) using either of the two above code snippets displays the icon perfectly and preserves the transparency. But again, if I were to pull my icon out of an imagelist to set me.icon, it would not display correctly.
So I know it is possible that I can correctly display icons in my application when I do not use an ImageList. Is there any way I can assign an icon to a ListViewItem without using an ImageList? I suspect the answer is yes, but only by overriding the ListView class, and I have no idea where to start with that.
Perhaps there is a special technique which I've overlooked for loading the ImageList?
I like my icons as they are, and don't really relish the thought of manually turning them into bitmaps...
Any help appreciated! Let me know if more info is required. I am using VB.Net 2003.
Thank you!
|
|
|
|