PDA

View Full Version : Visual Basic 6


abdulw11
October 16, 2007, 12:37 PM
I know there are quite a few programmers/Computer Science students here.

So I was wondering if anyone knew how to create command buttons with round corners in VB6? Or even if this is at all possible?

Thanks for any help in advance. :)

Kabir
October 16, 2007, 12:42 PM
I wanna learn VB and .NET. I'm a Java programmer.

Can someone direct me to a site where they have tutorials for dumb ones like me? I need to have everything given to me. And also, do I need to learn C for .NET?

I also need to learn a bit of ASP and making DB driven sites using ASP and .NET. Anyone can help me with that please? :)

abdulw11
October 16, 2007, 12:51 PM
Teach Yourself Visual Basic 6 in 24 hours (http://www.informit.com/library/library.aspx?b=STY_VB6_24hours)

Just found this site today. Quite good.

zahid
October 16, 2007, 12:52 PM
I wanna learn VB and .NET. I'm a Java programmer.

Can someone direct me to a site where they have tutorials for dumb ones like me? I need to have everything given to me. And also, do I need to learn C for .NET?

I also need to learn a bit of ASP and making DB driven sites using ASP and .NET. Anyone can help me with that please? :)


You need to learn C++ to learn C# and then C# to learn .NET.
OR VB > VBScript > .NET

To learn ASP.NET : Classic ASP > ASP.NET

DUMMIES Guides are good.

zahid
October 16, 2007, 12:53 PM
Teach Yourself Visual Basic 6 in 24 hours (http://www.informit.com/library/library.aspx?b=STY_VB6_24hours)

Just found this site today. Quite good.


6 onek purano. It's wiser to learn VB .NET or VB 2005 now.

AsifTheManRahman
October 16, 2007, 12:55 PM
Try something like this:

Dim tempRegion As Long
Dim roundControl As Control
Dim newRegion As Long

'Create a region with round corners
tempRegion = CreateRoundRectRgn(0, 0, roundControl.Width, roundControl.Height, 20, 20)

'activate/apply the new region
newRegion = SetWindowRgn(roundControl.hWnd, tempRegion, True)

The subs CreateRoundRectRgn and SetWindowRgn are in the gdi32 libraries. The variable roundControl represents your command button.

abdulw11
October 16, 2007, 12:58 PM
6 onek purano. It's wiser to learn VB .NET or VB 2005 now.

That's true, but VB6 is the program my college told us to code in, and it's the only one available there.

AsifTheManRahman
October 16, 2007, 01:00 PM
I wanna learn VB and .NET. I'm a Java programmer.

Can someone direct me to a site where they have tutorials for dumb ones like me? I need to have everything given to me. And also, do I need to learn C for .NET?

I also need to learn a bit of ASP and making DB driven sites using ASP and .NET. Anyone can help me with that please? :)

I took the J2EE -> .NET route. Mostly browsed around randomly. Since most of the concepts of web app dev are the same at a high level, it was a piece of cake. I don't like MS products though - they realize that there are shytee issues with their dev tools/environments/langauges, but either don't know the solution or create ones that are by no means ideal.

AsifTheManRahman
October 16, 2007, 01:04 PM
You need to learn C++ to learn C#

That's not really true, although in terms of learning programming in general, probably ideal because low level languages where you have to create every damn little thing on your own gives you lots of "insight".

Fazal
October 16, 2007, 01:08 PM
Try something like this:

Dim tempRegion As Long
Dim roundControl As Control
Dim newRegion As Long

'Create a region with round corners
tempRegion = CreateRoundRectRgn(0, 0, roundControl.Width, roundControl.Height, 20, 20)

'activate/apply the new region
newRegion = SetWindowRgn(roundControl.hWnd, tempRegion, True)

The subs CreateRoundRectRgn and SetWindowRgn are in the gdi32 libraries. The variable roundControl represents your command button.

too boring...

I was expecting something like that....

Dim BhuriRequirement As Long
Dim Dav_er_Bhuri As Control
Dim newCoacherBhuri As Long

'Create Bhuri Requirement
BhuriRequirement = CreateRoundRectRgn(0, 0, Dav_er_Bhur.Width, Dav_er_Bhur.Height, 20, 20)
'Nerw Coach-er Bhuri Requirement
newCoacherBhuri = SetWindowRgn(Dav_er_Bhuri.hWnd, BhuriRequirement, True)

AsifTheManRahman
October 16, 2007, 01:13 PM
so notun coacher bhurio golakar howa chai? goto 4 bochore prottek din tv screen er shamne boshe dav er ta dekhe shokh mitey nai?

Kabir
October 16, 2007, 01:15 PM
Fazal mamu at his best, again :floor:

I was a QB programmer before, and then to Java it took me less than a month or two to be an okay programmer.

I learnt C# to some extent, but was never able to run it on my machine since I didn't have it setup on my machine. I assume it'll be same problem that I'll run into with VB and .NET.

All I need is some basics about some of these...MS Canada is hiring :)

ATMR: Will tell them about your concerns if I get hired ;)

zahid
October 16, 2007, 02:22 PM
Microsoftey chakri ... :-D

Akash eto kasey na :)

AsifTheManRahman
October 16, 2007, 02:24 PM
Microsoftey chakri ... :-D

Akash eto kasey na :)

Microsoftey chakri is nothing hard. Microsoft Canada is even easier. :)

Kabir
October 16, 2007, 02:39 PM
Microsoftey chakri ... :-D

Akash eto kasey na :)

Allah'r rohmot e, my wife works there :)

However, it's nothing to brag about, and not so much like jobs at Oracle.

Kabir
October 16, 2007, 02:42 PM
Microsoftey chakri is nothing hard. Microsoft Canada is even easier. :)

Depends on what you're doing though. Some are dead easy stuff, and others are more difficult than you can imagine. Their interview process is a pain in the butt. My wife had to go through 5/6 of them, with an exam as well. Her job's related to DB, so not much programming related queestions. Interviews for developers' and architects are jom er kothin...coz they involve programming questions, and almost all of them require 8 interviews + tests.

AsifTheManRahman
October 16, 2007, 02:50 PM
Hmm...I guess I'm not in a position to comment on full time interviews, but I didn't think their SDE interviews for Seattle positions were too difficult although they involved a bunch of programming questions. From what I've heard, it seems that the level of difficulty has gone down over the years.

Then again, I'm a mere college student who hasn't met the post graduation realities of life.

Btw, would really like to try out the likes of Clockworx as suggested by Razab bhai in another thread, for fun if nothing else.

ialbd
October 16, 2007, 03:20 PM
i am paid (and brainwashed) to say Microsfot & .Net sucks...... and j2ee has been my life ever since.....

although I have used ASP (classic) and ASP.Net and MS Visual Web Developer. Its always fun, drag and drop and pull down menus and its quite easy to put together a nice looking AJAX enabled ura dhura web app....

P.S: Kabir bhai, bhabi Microsoft e kaj kore naki? MashAllah. Which microsoft is it? they just opened the vancouver lab, is there one in the GTA ??

AsifTheManRahman
October 16, 2007, 03:23 PM
i am paid (and brainwashed) to say Microsfot & .Net sucks...... and j2ee has been my life ever since.....


That's my boy...Sun/IBM >> MS (no offence Kabir bhabi)

Kabir
October 16, 2007, 03:25 PM
Which microsoft is it? they just opened the vancouver lab, is there one in the GTA ??

Headoffice, in Mississauga.

Vancouver is a development site, not for research. :)

Alien
October 17, 2007, 02:56 AM
I wanna learn VB and .NET. I'm a Java programmer.


Same. public static void maining korte korte din/raat choila jaye.

SS
October 18, 2007, 08:23 AM
I guess that's the charm of being a programmer...innovative, always into something new!! Good for all but all are not good...battle of opensource and muscle of richest software moguls...when demand is high so less supply when supply is abundant demand changes its path...excited to create a new program while debugging others lead to frustration..
can you guys program my life...Alas challenging God's programming!!!

Kabir
October 18, 2007, 08:37 AM
can you guys program my life...Alas challenging God's programming!!!

Sure, that's just a few steps away. You need medical intervention, and that is, a genetically engineered one. :)

If you know what I mean, then do read "The future of human nature" by Jurgen Habermas, by for one the best philosopher currently.

Bancan
November 25, 2007, 02:33 PM
I bought this book to learn VB. How would you do this Exercise 3 ? Please keep it simple. Like use only Do loop etc. Thanks. A solution as soon as possible will be helpful.


http://i66.photobucket.com/albums/h250/bancan/VB.jpg (http://photobucket.com)

AsifTheManRahman
November 25, 2007, 02:57 PM
Why don't you have a crack at it and let us know what you got, and maybe someone can help you out? That's the best way to learn programming. You'll have to have some code on you first.

Bancan
November 25, 2007, 03:06 PM
i spend last four hours trying to do it. I can make the input box come multiple times. but i cant end the loop. also i have no idea how to find the lowest and highest number from all the user inputs.

AsifTheManRahman
November 25, 2007, 05:31 PM
Well, you could play around with the Math.Max function, but a better way to do this would be to use a sorting algorithm. So every time the user enters a number, you can store it in an ArrayList or any other kind of list, and when the user is done with his input, you can sort your list so that the numbers appear in ascending/descending order, and pick the first and last items from the sorted list. If you're not familiar with sorting algorithms, check them out on the wiki. Bubble sort, while bloody inefficient, is easy to implement and probably the way to go for beginners.

As for stopping the buttons - think about it. If you can make an "enter" button show up several times, you should be able to make a "submit" button show up along with it too, which will trigger off the calculations. But then it seems there's ample leeway in how you design the user interface, and this is only a suggestion.

Bancan
November 25, 2007, 10:14 PM
Well, you could play around with the Math.Max function, but a better way to do this would be to use a sorting algorithm. So every time the user enters a number, you can store it in an ArrayList or any other kind of list, and when the user is done with his input, you can sort your list so that the numbers appear in ascending/descending order, and pick the first and last items from the sorted list. If you're not familiar with sorting algorithms, check them out on the wiki. Bubble sort, while bloody inefficient, is easy to implement and probably the way to go for beginners.

As for stopping the buttons - think about it. If you can make an "enter" button show up several times, you should be able to make a "submit" button show up along with it too, which will trigger off the calculations. But then it seems there's ample leeway in how you design the user interface, and this is only a suggestion.


my options are limited as i am only allowed to use things i have learned so far. but thanks for the help. i am trying to solve it and inching towards it hopefully.

Ahsan
November 25, 2007, 11:15 PM
my options are limited as i am only allowed to use things i have learned so far. but thanks for the help. i am trying to solve it and inching towards it hopefully.


if you are using InputBox function in loop for user to enter scores you can set a default value (you have to come with some value that user will not pick...e.g largest integer or lowest integer or even it can be some string value as return values can be treated as variant types) that will be returned if user does not enter anything.

And for highest/lowest score...if you can't use sorting as ATMR mentioned, then you can have two variables (e.g. highestScore and lowestScore). Set them both to the first value user enter. Then for subsequent scores (e.g. currentScore) user enters compare,





if highestScore<currentScore then highestScore=currentScore end if</pre><currentscore then="" highestscore="currentScore" end="" if=""><currentscore then="" highestscore="currentScore<currentscore" end="" if=""><currentscore then="" highestscore="currentScore" end="" if="">

if lowestScore>currentScore then lowestScore=currentScore end if
</currentscore></currentscore>
hope this helps!</currentscore>

Bancan
November 26, 2007, 10:47 AM
Option Explicit
Private intHighScore As Integer, intLowScore As Integer

Private Sub cmdEnter_Click()
Const intSentinel As Integer = -1
Dim strScore As String, intScore As Integer
lblScore.Caption = ""
strScore = InputBox("Enter Your Score", "Scores")
If strScore = "" Then
intScore = intSentinel
Else
intScore = strScore
End If
intHighScore = 0
intLowScore = 301
Do While intScore <> intSentinel
If intScore < intLowScore Then
intLowScore = intScore
End If
If intScore > intHighScore Then
intHighScore = intScore
End If
strScore = InputBox("Enter Your Score", "Scores")
If strScore = "" Then
intScore = intSentinel
Else
intScore = strScore
End If
Loop
End Sub

Private Sub cmdStats_Click()
lblScore.Caption = "The high score is" & Space(1) & intHighScore & Space(1) & "the low score is " & Space(1) & intLowScore
End Sub

Bancan
November 26, 2007, 10:52 AM
It worked.Thanks everybody.Now i am gonna do the second part

AsifTheManRahman
November 28, 2007, 03:34 PM
Here's one for the VBA gurus:

When I call a function from an Excel spreadsheet, I want to be able to pass the existing value of the cell into the function as well. I have tried Application.Caller.Value, but looks like the value of the cell gets reset every time I try to recalculate it, even before the function body gets executed. The column and row numbers of the calling cell seem to be fine, it's just that the value gets set to a big fat ZERO.

I can't use Ranges because the function can be called anywhere in the spreadsheet - I absolutely HAVE to access the cell calling it at a particular instance in time.

A work around would probably be to store the value of any new cell that is created in a dictionary object, with some sort of a concatenation of the row and column numbers of the cell as the key. While this comes in handy for purposes of recalculation, it essentially means that I'll end up making a copy of the entire spreadsheet (a humongous amount of data if i may add) in a data structure, which is rude to memory.

Anyone have any ideas?