Log in

Visual Basic Developer's Journal
[Most Recent Entries] [Calendar View] [Friends]

Below are the 20 most recent journal entries recorded in Visual Basic Developer's LiveJournal:

[ << Previous 20 ]
Saturday, February 9th, 2008
12:32 pm
Running a Service

I wrote a service in .NET for a friend of mine. The service is designed to append to a log file when a person opens a program (World of War-craft) or closes it with a time stamp. It will also close the program down automatically at a specific time if it is running, and not allow it to be opened between certain times of the day.

The problem I've run into is that when I started the service it runs on one user's account but not on the account it should be running on (the one where the game is played on). Does anyone know how to get a service to run for all users? I've looked into it and cannot find anything on this problem. Is there a way for a user to not allow services to be running when they are logged on?

Any help would be appreciated.
Friday, September 14th, 2007
4:03 pm
VBA question
About excel. Is there any simple way to check out is the Cell in the named Range or not?
Sunday, May 20th, 2007
12:07 pm
I am New and Need Help
I originally had 2 Comboboxes one listed the MODEL the other listed the FINISH  I've got a list box that I am using to display selections. The trouble I was having, was I couldn't figure out how to get these two items appear on one line example:  2304M .It would display on seperate lines. If someone could tell me how to connect them, I'll change it back. Right now I have the selections all in one combobox like 2304M
Also, I'd like to display the Date and Time that selections were made like 2304M  Monday May 21, 2007  1:00PM   all on one line.  I hope I haven't confused anyone, so please forgive me.
 Again the names of the boxes are cboModel and cboFinish and ListBox1. I need to know how all the info is saved after selections are made. There will be quite a few items in the ListBox at the end of the day.
Thank You and GodBless

Friday, March 30th, 2007
10:47 pm
Thanks and a New Question "Autoincrements?"
I want to thank you for the suggestions on my previous issues regarding combo boxes.
I decided to go with the visible/invisible option for 2 combo boxes, it was a lot easier to set up (for now).

Now I have a new question.
I have to add something to a database, which has an "orderNumber" which is a composite primary key.
Im not sure how my database would create the new order number or how to get my application to add the order number.
Here is the code I have so far-

'inserts the calculated order into tblPurchase
Me.TblPurchaseTableAdapter.Insert(txtProdID.Text, orderNum, prodQuantity, _
prodPrice, shipCost, salesTax, totalCost, Today)

'fills the dataset for the tblPurchase with data

Now someone suggeted I do this to fill in the order number:-

'retrieves the maximum current order number and increments it.
Dim orderNum As Int32 = Me.TblPurchaseTableAdapter.MaxOrderNum()
orderNum = orderNum + 1

But with my lack of knowledge on some of this, im not sure how to make/code a scalar query to the table adapter for the tblPurchase table that retrieves the maximum order number.

Any thoughts/suggestions on how I could do this?
Tuesday, March 27th, 2007
10:08 pm
Changing the data bound to a combo box
Hi all, I was wondering if anyone had some advice for the brick wall im running into on a project.
Ive tried different VB forums, and endless searches and I cant seem to find an answer.

Im writing the application in VS2005. The application is a product inventory for foods.
It is linking to an Access Database with 3 tables.

My form has a combo box at the top which allows the user to select the product by description.
It is linked to the description column of the products table.
In my file menu I have options that specify "Select > By Product Description" and "Select > By Product ID"

I cannot for the life of me find any examples of code for these select buttons, that will change the combo box to display either Product ID or Description based on choice?

Any help would be greatly appreciated.
Many thanks.

Current Mood: aggravated
Saturday, March 10th, 2007
12:03 pm
this might seem like a silly question
Could someone please tell me in layman's terms what the Math.Abs function does? I need to use it in order to calculate the difference between 2 data members of a class. I've tried googling it but I get even more confused.

Thank you for your help :)
Wednesday, February 21st, 2007
12:00 am
classes and methods
Are there any good websites on this subject? My professor's an ass and doesn't know how to teach so I'm going to teach myself.

Thank you in advance. :)
Monday, December 4th, 2006
2:40 pm
converting to an executable file
Hello! How would one convert their project into an application that can be used on any OS even if it does not have vb? Normally I'd check my textbook but I left it at home. I've never done this before. I'm using visual studio 2003.

I thank you in advance for your help! :)
Tuesday, October 17th, 2006
11:30 pm
Dynamic Arrays (Please help yet again)
Could someone please help?

Here's what I have to do:

1. Code PrintGradesButton to display the grade list in MessageLabel.
2. Code AddGradeButton to:
a)pop up with an input box and allow the user to enter the new grade.
intGrade = CInt(InputBox("Enter grade:"))
b) increase the size of the array by 1.
c) store the new grade in the array.

This is what I did but I'm not sure if it's right.

Private Grades() As Int16 'declare array on top of the form

In the AddGradeButton I have this code:

dim intGrade as int16
dim intValue as int16
intGrade = CInt(InputBox("Enter grade:"))
intGrade = GetUpperBound(+1)
ReDim Preserve Grade(intValue)
Grade(intValue) = intGrade

Does this look right to you?
Thursday, September 28th, 2006
11:59 pm
In serious need of help :(
Hello..I just need some assistance regarding something that I'm trying to do.

I need to create a procedure called SetFont with 2 parameters: a label parameter and a string parameter. This procedure will recieve a label object and define the label's font settings. The string parameter will be 1 byte: H, N or R. Inside the procedure I need to use a Select Case statement that examines the string parameter and sets the fonts as shown below:

Heading(H) - Font Name (comic Sans MS); font size 14 bold - true, italic - false, foreColor - any colour

Normal (N) font name (comic sans MS), font size: 11, bold - false, italic - false, foreColor - any colour

Refund (R) fontname (Arial), fontsize - 9, bold - true, italic- true, forecolor - any colour

Inside the other procedure (DisplayTotal - don't worry about this) I need to call SetFont as appropriate...

I've tried to figure this out but I can't make any sense of it for the life of me. I need to do it for one of my classes..I'm such a n00b at this

Anyways, thank you for your time..
Monday, September 25th, 2006
11:01 pm
I'll try to go through this as simply as I can as I don't know how complex this sounds. I'm using VB 6.0 and I'm developing a helper program for an old wargame called BattleTech, currently I have a main screen that lets you open a selector page for selecting only 4 robots from a pool of about 15 robots. The way you select is to double click the picture and that tells another form, which is also on screen, to add an item to its list box with just text saying the robot you selected ie if you double click the Robot Alpha picture an item appears with the text "Robot Alpha". Once all 4 robots are selected, and the selection screen is closed, you then select all the items in the listbox and click a button on that form which sends each list to an option button, on the main screen. The option button's caption is updated with each robot's name respectively ie the first robot on the list will go onto the first option button. These option buttons are in a control array and there are 4 of them.

This means that 1 robot could appear at least once at any of the 4 option buttons. What I would like the program to do is when the option button, for a robot, is clicked and a button is pressed it reads a file that contains information for walking, running and jumping and populates that into the text boxes i have on the main screen. I've already tried doing this numerous times only managing to get a little far with one robot. Here's the code I have so far

the button codeCollapse )

Those Dim a,b,c,d have been left there as I had been messing around with nesting extra For...Next loops.

Sorry for the longness of this post and I hope I've given enough information. If not then please let me know.

Thanks very much!
Sunday, September 17th, 2006
9:42 pm
Hi, guys.
I'm using GTMaskDate control of GreenTree (3d party control). It opens a calendar when user clicks on it and user can choose the date. Inside the calendar there are days of the week, usually it's order is: Sun, Mon, Tue, Wed, Thu, Fri, Sat. I need to change the order of the days for the russian project to be Mon, Tue, Wed, Thu, Fri, Sat, Sun.
Does anyone knows how can I define it in GTMaskDate? I read the GreenTree help, the explanations regarding the properties, method and events of this control but I didn't see anything concerning the order of the days in week.
Please, help!
Wednesday, August 30th, 2006
6:33 pm
Layered picture boxes in VB .NET?
I'm trying to layer picture boxes. Specifically, I've got a slide bar and an indicator. I'm trying to get the indocator to overlay the slide bar so I can move it, via code, left and right, depending on what the user has clicked.

For whatever reason, the bar is appearing OVER the marker and I can't make it reverse (so the smaller marker is floating over the bar. Is this possible?

Monday, August 28th, 2006
3:39 pm
Using SGrid2 FindSearchMatchRow() function
Hi 2 all!

Dose  somebody use the SGrid2 control from www.vbaccelerator.com?
I have one problem with it, may be you can help me:
How I can use FindSearchMatchRow(sSearchString As String, [bLoop As Boolean = True], [bVisibleRowsOnly As Boolean = True]) function, cause it nothing search in columns with ECGSortType other than CCLSortNumeric ?

I'd like to use this usefull function cause it's not good idea to completely rebuild datagrid by changing query to database.

Thank's to all.
Monday, August 14th, 2006
4:21 pm
VBScript to VB
I currently have a VBScript that connects to a database, pulls out some information, does a compairson and then sends an email if conditions are met. It works online but I need to find a way to make this run on a schedule and I think the best way is probably to write it as a Visual Basic exe and set it up on the web server using the Windows scheduler.

It's been about 5 years since I wrote a VB program so I was wondering if anyone out there could help me sort how to go about doing the same thing in VB as I did in VBScript? Or point me towards a tutorial that will let me connect to a database, run a query and send an email.
Sunday, July 30th, 2006
11:41 pm
Hi everyone :)
(I'm Russian so I'm sorry if any mistakes).

I need help...
I'm using Visual Basic 6.3 and I have a question: how to access internet via proxy?
My program is doing this: user choose some options and then program downloads a picture according to selected options.
I've searched in many places but can't find anything that can help me so I'll try so ask here...
Tuesday, June 13th, 2006
11:57 am
Read, ReadLine, and annoying text files.
So I have this file I'm trying to read into SQL Server with a DTS package that uses a VBScript component (which is why I'm posting here).

Easy code:
	do until x.AtEndOfStream
		name_of_junk_var = x.ReadLine
		msgbox name_of_junk_var

Now, here's the hard part. I won't be able to post an example of the file, because the reason I'm using ReadLine is that when I open the file in notepad, the characters I see between lines are unprintables (represented in notepad with those generic little rectangles that tell me nothing).

So, questions.

1. Is there any way to play with what ReadLine sees as a row delimiter?
2. If not, is there any way for me to discover what these unprintables are without endless trial-and-error (since I assume I'll be using Read if ReadLine can't be modified)?

Saturday, May 27th, 2006
5:06 pm
Adding a value to a table
Heeelp!!! I'm making a database in Access and I have this form that retrieves a Vendor's name from the Vendor table.

The thing is, it needs to - ugh how can I 'splain this without a picture? hm...

ven_id (PK)

check_ven_id (FK - looks up a value in the ven_id field in the vendor table)

combo box that looks up vendor.ven_name
several text boxes that enter info into the check table (such as check amount and check number)

The problem is, when I put the vendor name into the combo box, the form complains because it can't match vendor.ven_id with any values in check.check_ven_id

I need it to automatically enter the appropriate vendor ID into the check.check_ven_id field as soon as the vendor name is selected in the combo box and I can't for the life of me figure out how to do this.

Wow that was wordy. I hope you guys can decipher it. It would be much easier to explain it if you could see it.
Sunday, May 14th, 2006
11:56 pm
I don't know what this is called in VB.NET, so I'm not sure what to search for. I'm looking for the VB equivilant to the JAVA Vector, which is like an array, except you don't have to set the number of elements in it.

If you could point me in the right direction, I'd really appreciate it.

Thanks so much!

(updated for my own brain-deadedness)

Current Mood: frustrated
Wednesday, May 10th, 2006
2:24 pm
it never ends.....
i sometimes wish i had the time and money for a personal tuteor for this stuff.

i hav a program with 2 forms. we shall call them form 1 and form 2.

i would like to right some code in fomr 2 to add text to a list box in form 1.

anyone want to talk me through this?

thanks in advance....
[ << Previous 20 ]
About LiveJournal.com