Learner010 99 Posting Whiz in Training

/ operator divide numerator by denominator.

    4/2=2
    5/2=2 (due to both operands are integral type)

you can also get exact result by using type casting:-

    (float)5/2=2.5
    (float)a/2=depends on the value of `a`

so , don't forget to initialise the variable a. if it is of type auto then it will contain garbage value(if you don't initialise).

i think that now you don't have problem with this issue but if you have some more problems on it, then don't be hesitate to create new thread with appropriate title and ask you problem there(I am also a c++ Beginner).

Learner010 99 Posting Whiz in Training
Tutorial On Operators

Operators are the signs to the tell the compiler to perform specific task. The Operators fall into following categories :-

Arithmatic Operator
Relational Operator
Logical Operator
Bitwise Operator 
Miscellaneous Operator(i added Assignment Operators in this categeory) 

Arithmatic operators:-
There are following arithmetic operators:-

+       Add                     [6+2=8]
-       Subtract                [6-2=4]
*       Multiply                [6*2=12]
/       Divide                  [6/2=3]
%       Modulus(Reminder)       [7%2=1]

Relational Operator :-
Relational Operators are used to compare 2 values and result in true [1] or false [0].

<        less than
>       greater than
<=       less than equal to
>=      greater than equal to
==      equal to
!=      Not equal to

Lets take an example:-
A=5 and B=10

            CONDITION       RESULT
            A<B              TRUE
            A>B             FALSE
            A<=B         TRUE
            A>=B            FALSE
            A==B            FALSE
            A!=B            TRUE

Logical Operators:-

Logical operator are used to combine more than one expression .

&&      =       LOGICAL AND
||      =       LOGICAL OR
!       =       LOGICAL NOT

&& and || are binary operator whereas ! is unary operator. && and || are called binary because both work on 2 operand where ! works on single operand
&& Operator Produce 1[true] if the all expressions are true. And it produce 0[false] if any one expression is false. let’s see it truth table .

EXP1        EXP2        RESULT      
TRUE        TRUE        TRUE        
TRUE        FALSE       FALSE       
FALSE       TRUE        FALSE           
FALSE       FALSE       FALSE   

Lets see the example below(a=10,b=20,c=30)

Expression               Expression evaluation      Result 
a<b      &&     a<c           true    && …
ddanbe commented: Nice! +14
Learner010 99 Posting Whiz in Training

I'm going to work on a mobile-friendly design for the site.

its not necessary that after creating a mobile friendly website , it will successfully shown in all browsers. i think opera for mobile will be the major problem as i see.

so i think particular application will be better than design the site for mobile purpose.

and we all are excited to see daniweb.apk on playstore.

Learner010 99 Posting Whiz in Training

cout<<"welcome to daniweb";

Learner010 99 Posting Whiz in Training

I noticed most of the free ones are pretty sad

correct.

visit these

zedge.net
ringtones.mob.org
mobango.com

to get full access to these sites i recommend you to use these sites from your device

Learner010 99 Posting Whiz in Training

ok
i tried to put that code directly inside timer instead of putting inside a user defined procedure

so i put

Dim g As Graphics = Me.CreateGraphics
g.DrawString(ProgressBar1.Value & "%", New Font("Arial"), Brushes.Aqua, New Point(100, 100))

and it returns an error saying
Overload resolution failed because no accessible 'New' accepts this number of arguments.

Learner010 99 Posting Whiz in Training

so would you provide code using Graphics. Drawstring to draw text over progressbar with center aligned ?

Learner010 99 Posting Whiz in Training

i want to add a label over progress bar to show the percentage of the completed task .

i added the code :

            Label1.Parent = ProgressBar1
            Label1.BackColor = Color.Transparent

but now i can't see the label1 even.
so how to make label1 transparent.

Learner010 99 Posting Whiz in Training

thread solved

Learner010 99 Posting Whiz in Training

i already tried that code but the question is
when i have already defined (For Each lbl As Label) then why it is considering button also.

would you please tell about it ?

Learner010 99 Posting Whiz in Training

there are 10 labels and 1 button in the form and i want to set some properties using code(which will applicable to lable only) , and for this i used the code

 For Each lbl As Label In Form1.Controls
            lbl.Font = New Font("Arial", 12, FontStyle.Regular, GraphicsUnit.Point)
            lbl.Top = settop 
            lbl.Left = 40
            settop += 100
 Next

Now the error is

Unable to cast object of type 'System.Windows.Forms.Button' to type 'System.Windows.Forms.Label'.

how to solve that issue

Learner010 99 Posting Whiz in Training

i want to use module in Visual Studio with VB.NET

Learner010 99 Posting Whiz in Training

ok.
i replace Dim with pubilc when i will understand how to create a module.

Learner010 99 Posting Whiz in Training

as the title , i want to create module for my application . i found that module is used for global declaration or function / procedure defination.

but here i want to ask that how to create a module in vb.net which is applicable to all the window forms of the application(for ex: i put Dim a As Integer=10 then this a will be applicable to form1 as well as form2 and so on ).
whether i have to create another module file what we do in vb6 OR there is something other way to create it. if possible then please put a very simple syntax or code so that i can understand the concept behind module.

Learner010 99 Posting Whiz in Training

thanx for providing code but this is not working
here are two errors , it showing:-

Error 1 Expression Expected
Error 2 Comma, ')', or a valid expression continuation expected.

this is pointing to the line 12 of your code.

Learner010 99 Posting Whiz in Training

its working but another problem still there and that is

it works for one time only.
second time when i click on button and then input the name then it returns an error saying :-NullReferenceException was unhandled
object reference not set to an instance of object

error in procedure1

but when i remove the following lines then its working

            rs = Nothing
            con = Nothing

please explain why error occuring when using these lines

another one question is that what path does My.Application.Info.DirectoryPath return (i mean obj directory or bin directory or other directory)

i think its bin directory.

Learner010 99 Posting Whiz in Training

Any Solution ?

Learner010 99 Posting Whiz in Training

creating buttons dynamically is 100% possible
you can use the code as follow in order to create a button during runtime:-

        Dim btn As New Button
        btn.Name = "Button1"
        btn.Text = btn.Name
        btn.Location = New System.Drawing.Point(100, 100)
        btn.Font = New Font("Arial", 10, FontStyle.Regular)
        Me.Controls.Add(btn)

And

and buttons of text trough character bit map

i didn't understand that.

Learner010 99 Posting Whiz in Training

i updated the code as follow :-

Dim query As String = "Select * from ADODB where firstname='" & str & "'"

            If rs.EOF = True Or rs.BOF = True Then
                MsgBox("record not found")
            Else
                Me.TextBox1.Text = rs.Fields(1).ToString
                Me.TextBox2.Text = rs.Fields(2).ToString
                Me.TextBox3.Text = rs.Fields(3).ToString
            End If

now getting no errors but unexpected result :-

in textbox1 there is text "ADODB.InternalField"
and the same in textbox2 and textbox3

Learner010 99 Posting Whiz in Training

i want to retrieve data from Access table but i don't know where i am going wrong.here i am going to show my work which return errors:-

Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset


Public Sub procedure1()
        con.Provider = "Microsoft.jet.oledb.4.0"
        con.Open(My.Application.Info.DirectoryPath & "\Database1.mdb")
End Sub



 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

            Dim str As String = InputBox("enter first name to search")
            Dim query As String = "Select * from ADODB where firstname="&str
            procedure1()
            rs.Open(query, con, 2, 3)
            If rs.EOF = True Or rs.BOF = True Then
                MsgBox("record not found")
            Else
                Me.TextBox1.Text = rs.Fields(1).ToString
                Me.TextBox1.Text = rs.Fields(2).ToString
                Me.TextBox1.Text = rs.Fields(3).ToString
            End If
            rs.Close()
            con.Close()
            rs = Nothing
            con = Nothing
End Sub

error message showing that there is something wrong at line 17

Learner010 99 Posting Whiz in Training

And what about parameter passing ?

Learner010 99 Posting Whiz in Training

i want to call event procedures (button1_click etc.) on certain conditions

Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
If e.KeyChar = "A"  then 
     'here i don't know how to call button1_click procedure   
End If

here is what i want to do :-

whenever any character is inputted to textbox1 then it will call button1_click where i code to print ascii value of the character

ex:- if i input A to textbox1 then should print 65

so i dont know to how to call button1_click event procedure with parametes as "A"

Learner010 99 Posting Whiz in Training

now i got the solution
thanx for your assistance to this thread

Learner010 99 Posting Whiz in Training

last questions , now i am facing difficulties to add controls to the groupbox , so how to add these controls to the groupbox or other container .

Learner010 99 Posting Whiz in Training

thanx , i added something then its really working

your method will generate btn.Name like btn 1, btn 1.5 ,btn 2 and so on

so , i add the following :-

Static y As Integer
btn.Name = "btn" + (y + 1).ToString.PadLeft(2)
y = y + 1

but a few things still i want to ask:-

1.what does mean by this line Dim ClickedButton As Button = DirectCast(sender, Button)

2.still one more question i asked in my thread(quiet different topic) is
how to display color palatte window in vs2008 so we can create color of our own wish?

Learner010 99 Posting Whiz in Training

i used the following to generate controls at runtime(it may be incomplete . . .)

  Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Static x As Integer
        Dim btn As New Button
        btn.Text = "this is button"
        btn.Top = 100 + x
        btn.Left = 100
        x = x + 100
        Me.Controls.Add(btn)
    End Sub

it generate but the problem is that how to use those controls which are created dynamically.

for ex:- how to execute specific code on the click event of first dynamically created button and execute something other code for second dynamically generated button.
In short , i want to work on their events . . .

Learner010 99 Posting Whiz in Training

thanx for quick reply
I need to add window for color palette so that it will be used while designing the form but the link provided by you does not seem to solve this as it deals with color dialog box at runtime(probably, as I didn't read the article completely)

the another thing is that
would you provide sample code to create controls dynamically ?

Learner010 99 Posting Whiz in Training

how to create controls(like button , textbox) dynamically , i want to create these for 10 or may be more than 10 times .

so i think i have to go through loops and probably i can do that but the problem is that how to create controls in runtime. is this possible to achieve that using control array ?

one more question is that how to display color palatte window in vs2008 so we can create color of our own wish?

Learner010 99 Posting Whiz in Training

thanx , its really working and helped
one more thing i want to consult here is that "does Like is same as = in conditions ?"

Learner010 99 Posting Whiz in Training

thanx for the code but still i need to do this using for each loop not for next(it will provide the opportunities to learn something new, as i am beginner to VB.NET)

Learner010 99 Posting Whiz in Training

but if i just want to know at which location item is found Then ?

Learner010 99 Posting Whiz in Training

i want to traverse a checkedlistbox using for each loop
for example :- if i want to see that a particular item name exist in checkedlistbox or not. so i think that i need to use for each loop but really don't know how to traverse checkedlistbox using for each loop.

for each "here i dont know what to use" in checkedlistbox1
    if <condition is true> then
        messagebox("Item found")
    End if
next
Learner010 99 Posting Whiz in Training

But try the following:
In the code editor there are two drop down lists at the top. In the right list choose InitializeComponent and you should see code for your designed labels,buttons etc.

this helped to see the source of designed controls.

this thread is really bizarre thread (i asked for something and i got something other(but really important for beginners like me))

thanx for giving your important time to this discussion.

Learner010 99 Posting Whiz in Training

ok , so we can't do that in design time .
yes i know that we can chage these properties but these will not make any sense while designing the form.

Learner010 99 Posting Whiz in Training

i also see solution explorer but there is not a file like form.designer.vb but there are files (form files also) when i double clicked on one of these files then selected form file appear with title form1.vb[Design] (when designing the form) and when coding for that form then title form1.vb

but no file i found where i can see the source of designed controls....

Learner010 99 Posting Whiz in Training

thanks for reply
but i didn't mean that what you replied.
i want to use these three button in design time but what you say is just belong to something happening with form in runtime.

you can think of my problem as :- if you want to maximize the form in design time(not in run time) so you have to scale the form width of height using mouse dragging(i.e. can't maximize directly), so any ideas to activate these three buttons in design time.

hope i explained the problem clearly . . .

Learner010 99 Posting Whiz in Training

i visit MyProject Folder through Window Explorer and i found that there are few files like

Application.Designer.vb
Resource.Designer.vb
Setting.Designer.vb etc.

but there is not seperate designer file for each Form

I am using Visual Studio 2010. You?

well i am using Visual Studio 2008 and probably thats the reason i cant see particular designer file for each form.

Learner010 99 Posting Whiz in Training

I am not able to see this code in my application

so what to do to see this auto generated code...

I also double clicked on the form and the code window appears , there i found no source code for designed controls

Learner010 99 Posting Whiz in Training

I just copied that line from the form1.Designer.vb file

i see form1.Designer.vb file but there is not code so how did you copy that line from that file.
please tell a little bit about it . . .
thanx

Learner010 99 Posting Whiz in Training

why control box(minimize , maximise and close button) is not accessible in design time in vb.net or there is another method to activate these tools.

Learner010 99 Posting Whiz in Training

ok i will download VS 2010 and then i will try to practice on it And would you like to share the link where i can find ebooks regarding this language(like Programming F# (Animal Guide) by Chris Smith)

well one more question:-
what types of application can be made using this language . . .(like console,window,web etc.)

Learner010 99 Posting Whiz in Training

thanks for providing very interesting code
first i dont understand the following statement
GraphicsUnit.Point, CType(0, Byte)

so would you like to explain it .....

And Other thing is :-------
but still i need to learn how to put text to form without using controls so is there anyway by which i can achieve that ?

Learner010 99 Posting Whiz in Training

i dont know about f#
i wanna practice on it and for this i have a few questions :-

does it a new language ?
is it available with visual studio 2008 ?(i dont find it in 2008)

Learner010 99 Posting Whiz in Training

i want to put text to Form and for this purpose i dont want to use label . . .

Learner010 99 Posting Whiz in Training

i didn't mean to print the hardcopy of the form but to put text to window form as we do in vb6 using Print

Learner010 99 Posting Whiz in Training

we use Print to print text to form in vb6
and dont know how to print text to window form in vb.net
please explain how to achieve it . . .