Jx_Man 987 Nearly a Senior Poster Featured Poster

this following code to save int file into DAT file :

# include <iostream.h>
# include <fstream.h>

void main ()
{
	int data[] = { 23, 456, 678, 2314, 20, 56, 30981};
	cout<< "Record Data...." <<endl;
	ofstream file_data("INT.DAT", ios::binary);
	for (int i = 0;i < (sizeof(data)/sizeof(int)); i++)
		file_data.write((char *) &data[i], sizeof(int));
	file_data.close();
}
dnk commented: Perfect +1
Sawamura commented: Thanks +3
Jx_Man 987 Nearly a Senior Poster Featured Poster

you mean the form can be change like opacity.If i right then try this following code :
add this following code to module :

Private Declare Function GetWindowLong Lib "user32.dll" Alias "GetWindowLongA" (ByVal hwnd As Long,ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32.dll" Alias "SetWindowLongA" (ByVal hwnd As Long,ByVal nIndex As Long,ByVal dwNewLong As Long) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long,ByVal nCmdShow As Long) As Long
Private Declare Function SetLayeredWindowAttributes Lib "user32.dll" (ByVal hwnd As Long,ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long

Private Const GWL_EXSTYLE As Long = -20
Private Const WS_EX_LAYERED As Long = &H80000
Private Const LWA_ALPHA As Long = &H2

Public Function Transparant(hwnd As Long, percent As Integer,pil As Boolean)
	Dim before as Long
	before = GetWindowLong(hwnd,GWL_EXSTYLE)
	If pil = true then
		before = before Or WS_EX_LAYERED
		SetWindowLong hwnd, GWL_EXSTYLE, before
		SetLayeredWindowAttributes hwnd, 0, 255 * (percent / 100), LWA_ALPHA
	Else
		before = before And Not WS_EX_LAYERED
		SetWindowLong hwnd, GWL_EXSTYLE, before
	End If
End Function

you can call the function like this :

Transparant Form1.hwnd, val(txtPercent.text), true

you can change text box with other control to get value as percent

Ok. Hope it helps..

Jade_me commented: really complex +1
ITKnight commented: confusing but this a nice code +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

shell function used to apply/run other application and sava the task ID of that application as feedback value. so if none application or failed to call then the feedback value is 0.

this following code is used sintax :
shell(path_Name[,style][,wait][,timeout])
path_name = executable file with the full path of the application which it want to call
Style = a model of application window which it want to call (ex minimize,normal etc).
Wait = a boolean value that prescriptive whether shell function has to wait vb.net finish before working. false is the default value.
TimeOut = a wait time that it needful by shell function to start working if Wait in true value.

Ok.this a little explain. hope it helps..

Jade_me commented: Really Helps to me +1
dnk commented: great explaination +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

try this following code and change the code as you needed :

CrystalReportViewer1.selectionFormula = "Date({DbName.TableName})>= #" & DateTimePicker1.value & " # And Date({DbName.TableName})<= #" & DateTimePicker2.value & "#" 
CrystalReportViewer1.RefreshReport()
Sawamura commented: thx +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

hi, i have same idea like alekhan too. this is completed task in building database like what alekhan describe. but you will get a complex db.:)
so have a nice try.

Jx_Man 987 Nearly a Senior Poster Featured Poster

I Can Do Everything Through HIM Who Gives Me Strength

Jx_Man 987 Nearly a Senior Poster Featured Poster

Where there is a will, there is a way

Jx_Man 987 Nearly a Senior Poster Featured Poster

To be a winner, all you need is to give all you have

Jx_Man 987 Nearly a Senior Poster Featured Poster

people become fools when they stop asking questions

Jx_Man 987 Nearly a Senior Poster Featured Poster

A Champion is someone who gets up even when they can't

Jx_Man 987 Nearly a Senior Poster Featured Poster

what project do you want?how about get the computer name?

Jx_Man 987 Nearly a Senior Poster Featured Poster

use timer and label.
try this following code :

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        lbl1.Text = Microsoft.VisualBasic.Right _
       (lbl1.Text, 1) & Microsoft.VisualBasic.Left _
       (lbl1.Text, Len(lbl1.Text) - 1)
    End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.Timer1.Enabled = True
        Me.lbl1.Text = " WELCOME -- "
        Me.Timer1.Interval = 200
    End Sub

Ok. Hope This Helps...

Jx_Man 987 Nearly a Senior Poster Featured Poster

you cannot call controls directly cause friends status of controls.even if you change the modifiers to public. so i suggest to use public shared variable. you can access this variable form other form...
this declaration of the variable :

Public Shared value As Integer

this assignment value from NumericUpDown1 to value :

value = NumericUpDown1.Value

this code to call this variable in other form:

Label1.Text = Form1.value
Jx_Man 987 Nearly a Senior Poster Featured Poster

if i not wrong, it's the old name for what are now Xbase files.so basically anything that will open Xbase should open xdb.
It is also the extension given to Norton Anti Virus updates

Jx_Man 987 Nearly a Senior Poster Featured Poster

how about decision support system for marketing enterprise. asp with C# is good

Jx_Man 987 Nearly a Senior Poster Featured Poster

asia....

which asia dnk??

Jx_Man 987 Nearly a Senior Poster Featured Poster

so, u want to show image/photos on image or picturebox then when u click that control you will browse image to show, right? if i didn't wrong in understand your post, this is code for showing image..
add microsoft common dialog 6.0 control on add componet. use common dialog on your form.

Private Sub Image1_Click()
With CommonDialog1
            '.InitialDirectory = "C:\"
            .Filter = "All Files|*.*|Bitmaps|*.bmp|GIFs|*.gif|JPEGs|*.jpg"
            .FilterIndex = 4
End With
CommonDialog1.ShowOpen
Image1.Stretch = True
Image1.BorderStyle = 1
Image1.Picture = LoadPicture(CommonDialog1.FileName)
lblFilePath.Caption = CommonDialog1.FileName
End Sub

filter index to set image extension when first open dialog shown.
lblFilePath just for showing file path, if u dont like it to shown you can remove it.

OK.give feedback

Jx_Man 987 Nearly a Senior Poster Featured Poster

add/drag opendialog control in your form , one label (for path view), one picture box (for image view) and one button (for browse image).
in your button browse add this code :

With OpenFileDialog1
            '.InitialDirectory = "C:\"
            .Filter = "All Files|*.*|Bitmaps|*.bmp|GIFs|*.gif|JPEGs|*.jpg"
            .FilterIndex = 4
        End With

        If OpenFileDialog1.ShowDialog() = DialogResult.OK Then
            PictureBox1.Image = Image.FromFile(OpenFileDialog1.FileName)
            PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage
            PictureBox1.BorderStyle = BorderStyle.Fixed3D
            lblFilePath.Text = OpenFileDialog1.FileName()
        End If

you can change the filter index to set image extension at first open. in this code filter index = 4 will set to jpeg, so when first open just jpeg image will shown. change filter index as u need.

Ok. all for the best

Jx_Man 987 Nearly a Senior Poster Featured Poster

u mean that value from the numericupdown will read in next from?
i suggest to use public shared variable to accomodate the value from numericupdown.then u can call the variable in other form.

Jx_Man 987 Nearly a Senior Poster Featured Poster

i didn't play games on internet, just playing games installed on my computer. i m just playing winning eleven 9 and this game did not needed a high requirment.

Jx_Man 987 Nearly a Senior Poster Featured Poster

i would pinching my cheek to make me woke up from the dreams...

how about after you pinching your cheek and nothing happened? i means you didn't woke up but still in 1982. are you still pinching?:twisted:

Jx_Man 987 Nearly a Senior Poster Featured Poster

When you say see, do you mean watch him come out? Because you might throw up....

i hope i can, but its impossible cause my family didn't know me (i m not born yet).

Jx_Man 987 Nearly a Senior Poster Featured Poster

yes i was searched the file with google before but nothing complete just a little one.
please help me...

Jx_Man 987 Nearly a Senior Poster Featured Poster

include using System.Windows.Forms

yes i m include this file.any suggestion?

Jx_Man 987 Nearly a Senior Poster Featured Poster

hmmm...maybe thats one of the problem causes. i will upgrade my ram into upper of 512 Mb...
any other suggestion??

Jx_Man 987 Nearly a Senior Poster Featured Poster

oh no i wasn't even born, but i want to see my brother born...

Jx_Man 987 Nearly a Senior Poster Featured Poster

set the background image,FlatStyle,ImageAlign and size on your button properties it will like this..

Jx_Man 987 Nearly a Senior Poster Featured Poster

what the effort of your program?

Jx_Man 987 Nearly a Senior Poster Featured Poster

tes.....
Shown.....

Jx_Man 987 Nearly a Senior Poster Featured Poster

check the startup project in your project properties..

Jx_Man 987 Nearly a Senior Poster Featured Poster

hmmm...
this never ending. everyone/nation think they right. to many thoughts and all be in contradiction.
actually peace start from ourself. so we can't compulse other people to change but we must change.

Jx_Man 987 Nearly a Senior Poster Featured Poster

we don't remember days.
we remember moments.
Make moments worth remembering.

Jx_Man 987 Nearly a Senior Poster Featured Poster

actually my computer has a nice specs.
intel p 4 2,8 ghz
512 Mb of RAM
ATI Radeon 9200 AGP 128 Mb

And i just playing Winning Eleven 9. thats any relation about the hardware? i got this problem since i install wireless card on my computer, but the wireless running good.

Pleas Helps..

Jx_Man 987 Nearly a Senior Poster Featured Poster

frmTwo.chkBox.Checked called from frmOne

you cannot call directly cause its private. you cannot access the controls in frmTwo from frmOne, it cause all of controls is private. because of the private state i suggest to use shared variable.

Jx_Man 987 Nearly a Senior Poster Featured Poster

Sql Server is a nice one

Jx_Man 987 Nearly a Senior Poster Featured Poster

not a public variable but public shared variable.
this ex of the code (this code running clearly in vb.net 2003, you can try in vb.net 2008 ):

eg your first form named Login

Public Shared Name As String
....
    Name = txtUserId.text

and this for the call in other forms :

...
lblNameUser.Text = "Welcome " & Login.Name

you can modified this code to accomodate check box state.

OK.Hope this helps..

dnk commented: i did not know about this variable before +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

thx WolfPack...

Jx_Man 987 Nearly a Senior Poster Featured Poster

hi dani...
may i know how can to add my Reputation-Altering Power?i got a little confused here..

thx. best regards..

Jx_Man 987 Nearly a Senior Poster Featured Poster

hi all,
i was implemented the code correctly but i got this following error :
The type or namespace name 'DataGridViewEventHandler' could not be found (are you missing a using directive or an assembly reference?)

i use vb.net 2003 and sqlserver 2000

i stuck on here, i was written a code but when i click datagrid nothings happened..
this my code that i was tried before :

private void dgUser_Click(object sender, System.EventArgs e)
{
	int i;
	SqlConnection cnn;
	SqlCommand cmdUser = new SqlCommand();
	SqlDataAdapter daUser = new SqlDataAdapter();
	DataSet dsUser = new DataSet();
	DataTable dtUser = new DataTable();
			
	i = dgUser.CurrentRowIndex;
	cnn = (System.Data.SqlClient.SqlConnection) Koneksi.GetConnect();
	try
	{
		cmdUser = cnn.CreateCommand();
		cmdUser.CommandText = "SELECT * FROM Users where Id_User ='" + dgUser.GetCellBounds(i,0)   + "'";
		daUser.SelectCommand = cmdUser;
		daUser.Fill(dsUser, "Users");
		dtUser = dsUser.Tables["Users"];
				
		if (dtUser.Rows.Count > 0)
		{
			
			txtUserId.Text = System.Convert.ToString(dtUser.Rows[0][0]);
			txtPasw.Text = System.Convert.ToString(dtUser.Rows[0][2]);
			switch (System.Convert.ToString(dtUser.Rows[0][1]))
			{
				case "1":
						
				cmbStatus.SelectedIndex = 0;
				break;
				case "2":
							
				cmbStatus.SelectedIndex = 1;
				break;
				case "3":
							
				cmbStatus.SelectedIndex = 2;
				break;
			}
		}
				
	}
		catch (Exception ex)
	{
		Interaction.MsgBox("Error: " + ex.Source + ": " + ex.Message, MsgBoxStyle.OKOnly, "Koneksi Error !!");
	}
}

Please help me.....
best regards..

Jx_Man 987 Nearly a Senior Poster Featured Poster

actually dataset its important think when you create crystal report. dataset will use to load the table as you want, one or more table.
if u use data adapter to generate dataset, you can configure what table which you want to show in query builder. check every table that you want to load in query builder. after configure data adapter you can generate dataset which include every table that u want like you choose in query builder before.

Hope this helps..

Jx_Man 987 Nearly a Senior Poster Featured Poster

make some shared variable to accommodate state of check box has checked or not. so with shared variable you can access the value of check box from other forms.

Jx_Man 987 Nearly a Senior Poster Featured Poster

you didn't have server...

New SqlConnection("server=;database=tempdb;uid=;pwd=")

what is your server name??

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi all...
I m working for my graduated project. and my method in using is Genetic K-means Algorithm. i m using vb.net 2003 and sql server 2000. Does Anyone know a sample code for this?or a website / link for this topic???

please help me...
any reply really appreciated...
Thx.Best regards...

Jx_Man 987 Nearly a Senior Poster Featured Poster

thx SCBWV...
nice recovery for my post...

Jx_Man 987 Nearly a Senior Poster Featured Poster
Jx_Man 987 Nearly a Senior Poster Featured Poster

try this following code :

' This code for string input or other (comma,drop,question mark etc) except numeric

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii < 48 Or KeyAscii > 57 Then
Text1.Locked = False
Else
Text1.Locked = True
End If
End Sub

' This code for numeric input only, other input cannot be written

Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii < 48 Or KeyAscii > 57 Then
Text2.Locked = True
Else
Text2.Locked = False
End If
End Sub

' This code for string input only (drop, comma, question mark cannot be written)

Private Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii > 65 Or KeyAscii > 97 Then
Text1.Locked = False
Else
Text1.Locked = True
End If
End Sub

actually you can combine this with ascii code. look the code in ascii table and you can let what input can be written.

OK.hope this helps..

Jx_Man 987 Nearly a Senior Poster Featured Poster

Right..., please post the screen shot what splashform that you want...

Jx_Man 987 Nearly a Senior Poster Featured Poster

what db that u using?
if u use sql server 2000, try this following code :
this code will fill the combobox ..

Private Sub BacaData()
        Dim i As Integer
        Dim cmdTraining As New SqlCommand
        Dim daTraining As New SqlDataAdapter
        Dim dsTraining As New DataSet
        Dim dtTraining As New DataTable
        Dim conn As SqlConnection

        conn = GetConnect()
        Try

            cmdTraining = conn.CreateCommand
            cmdTraining.CommandText = "SELECT * FROM Training"
            daTraining.SelectCommand = cmdTraining
            daTraining.Fill(dsTraining, "Training")
            dtTraining = dsTraining.Tables("Training")
            For i = 0 To dtTraining.Rows.Count - 1
                cmbId_Training.Items.Add(dtTraining.Rows(i).Item(0))
            Next

        Catch ex As Exception
            MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OKOnly, "Error Connection!!")
        End Try
        conn.Close()
    End Sub

if u using list box u can change "cmbId_Training.Items.Add(dtTraining.Rows(i).Item(0))" with this one "ListBox1.Items.Add(dtTraining.Rows(i).Item(0))".

hope this helps...

brightmohan commented: Excellent. +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

hi x2per14...
actually i a newbie too in api programing..but i try to explain with my own what api is.

application programming interface (API) is a source code interface that an operating system or library provides to support requests for services to be made of it by computer programs.
every operating system has api in their system. In windows api kept on dll file..
api can do many things, like you can access all information from system, access bios information, you can manipulate system, access the port of your pc, access the hardware of your pc, monitor information,vga, you can make nice screen (like xp or vista), you can make screensaver, or anything (many things that u ever imagine can do with api)
How it work? you can use api with use the api function, there are hundred (maybe thousand) of api function. i just know a little of api function (from book).
To use api you must understand what api function can do. even you can combine two or more api function in one program.

it is all of my explain about api.sorry if i can't explain more details because i a beginner too. :'( if u didn't felt satisfied with my explain you can make new thread an ask what api is, many people here already to help you more...:)

NB :give u e-mail address and i will send you two software to help u to understand api (you can …

Jx_Man 987 Nearly a Senior Poster Featured Poster

i would build a software development house...it my dreams...:P