Symbianize Forum

Most of our features and services are available only to members, so we encourage you to login or register a new account. Registration is free, fast and simple. You only need to provide a valid email. Being a member you'll gain access to all member forums and features, post a message to ask question or provide answer, and share or find resources related to mobile phones, tablets, computers, game consoles, and multimedia.

All that and more, so what are you waiting for, click the register button and join us now! Ito ang website na ginawa ng pinoy para sa pinoy!

VB.NET Programming Corner!

ano po ibig sabihin nyo TS, I will filter the rows by even nos? or I will put the even nos in the last column in exact row?

add a new column at the end and populate it with
2
4
6
8
10
so on

bale nakadugtong sya sa rows mo
every row, add a column, having a series of EVEN numbers

my point here pare is ganito:
your method in your last post is good, pero madami limitation,
like formatting ng rows palang,

i am just challenging you if you can do yung sinasabi ko using your method na SHORT CODE


sometimes kasi ang mga newbies naghahanap ng mas maikling code, akala nila the shorter the better.

its not the shortest or the longest, its the elegance of code,
its how you apply the solution
 
normally nga ganito ginagawa



ilagay mo sa thread yung class:
then sa NEW, lagay ka parameter
then call mo na yung method sa class

Code:
Public Class MyProcessClass
dim _Param as string =""
Friend Sub New(parameter1 as string)
.....
_Param = parameter
End Sub

Friend Sub DoProcess()
...
_Param = .........

End Sub

Friend ReadOnly Property ProcessResult as string
... return result of DoProcess
End Property

End Class


'function call form calling procedure

Code:
Private Function StartProcess as boolean
dim parameter as string = "test"
dim cProcess as New MyProcessClass(parameter) 'pass the parameter thru this
Dim t As New Thread(AddressOf cProcess.DoProcess)
t.Start() 'start the thread

'======== pwede mo lagyan ng timeout yung thread, lalo pag BLOCKING ang thread
 If t.Join(1000) Then
            If cx.ProcessResult Then
                Return True
            Else
                Return False
            End If
 Else
            Return False
 End If

End Function
'pag NON BLOCKING; pwede mo i attach sa eventhandler kung may event yung class mo
'para pag natapos yung thread, mag trigger yung event



**note: sa notepad lang ako nagtype, so may syntax error to, pero itoi yung basic steps

ahh ok, gagawa pala ng class thanks po
 
add a new column at the end and populate it with
2
4
6
8
10
so on

bale nakadugtong sya sa rows mo
every row, add a column, having a series of EVEN numbers

my point here pare is ganito:
your method in your last post is good, pero madami limitation,
like formatting ng rows palang,

i am just challenging you if you can do yung sinasabi ko using your method na SHORT CODE


sometimes kasi ang mga newbies naghahanap ng mas maikling code, akala nila the shorter the better.

its not the shortest or the longest, its the elegance of code,
its how you apply the solution

So meaning, hindi naka save sa database yung column na my even nos? Lalabas lang kung pinapopulate ang datagrid, ganun ba yun? Medyo mahihirapan ako nyan TS... tzk3!
 
So meaning, hindi naka save sa database yung column na my even nos? Lalabas lang kung pinapopulate ang datagrid, ganun ba yun? Medyo mahihirapan ako nyan TS... tzk3!

yes, tama ka ganun nga.

heheh
isa pa, pde ka rin mag lagay ng image sa cell na galing sa file for every row
yung image depende sa status ng isang record:

for example;

field status = "1"
ang image sa Column2 is "C:\Temp\Ok.jpg"

field status = "0"
ang image sa Column2 is "C:\Temp\Low.jpg"

etc......

every row yan


try mo yan
 
yes, tama ka ganun nga.

heheh
isa pa, pde ka rin mag lagay ng image sa cell na galing sa file for every row
yung image depende sa status ng isang record:

for example;

field status = "1"
ang image sa Column2 is "C:\Temp\Ok.jpg"

field status = "0"
ang image sa Column2 is "C:\Temp\Low.jpg"

etc......

every row yan


try mo yan

Hehehe.. nakuha kuna TS yung even nos! Tzk3... Wala sa database yung records, but pag.pinapopulate ko yung datagrid, andun yung even nos.. ang range ng even nos ko ay nka base kung ilan rows ang nasa database! tzk3..
 
Hehehe.. nakuha kuna TS yung even nos! Tzk3... Wala sa database yung records, but pag.pinapopulate ko yung datagrid, andun yung even nos.. ang range ng even nos ko ay nka base kung ilan rows ang nasa database! tzk3..

ipost mo kung papano mo ginawa
wala sa sql query yun ha

how about yung sa image sa cell?
gaya neto?
wala sa databse yung image, nasa file, depende sa currency

attachment.php
 

Attachments

  • Capture.PNG
    Capture.PNG
    20.1 KB · Views: 1,243
Last edited:
ipost mo kung papano mo ginawa
wala sa sql query yun ha

how about yung sa image sa cell?
gaya neto?
wala sa databse yung image, nasa file, depende sa currency

attachment.php

di ko pa na try yan TS pero kung pwepwersahin mo ako, gagawin ko yan! naka attach po yung program ko.. tingnan mo nalang, pwede mo e.edit yung database.. makita mo na walang no's sa "Counter" column..
 
di ko pa na try yan TS pero kung pwepwersahin mo ako, gagawin ko yan! naka attach po yung program ko.. tingnan mo nalang, pwede mo e.edit yung database.. makita mo na walang no's sa "Counter" column..

well yan ang ok, you are up to the challenge!
sige try mo gawin,

btw. walang naka attach na file.....
 
aww.. di ko pala na attach! Bukas ko nalang e.edit, nasa office kasi eh!
 
normally nga ganito ginagawa



ilagay mo sa thread yung class:
then sa NEW, lagay ka parameter
then call mo na yung method sa class

Code:
Public Class MyProcessClass
dim _Param as string =""
Friend Sub New(parameter1 as string)
.....
_Param = parameter
End Sub

Friend Sub DoProcess()
...
_Param = .........

End Sub

Friend ReadOnly Property ProcessResult as string
... return result of DoProcess
End Property

End Class


'function call form calling procedure

Code:
Private Function StartProcess as boolean
dim parameter as string = "test"
dim cProcess as New MyProcessClass(parameter) 'pass the parameter thru this
Dim t As New Thread(AddressOf cProcess.DoProcess)
t.Start() 'start the thread

'======== pwede mo lagyan ng timeout yung thread, lalo pag BLOCKING ang thread
 If t.Join(1000) Then
            If cx.ProcessResult Then
                Return True
            Else
                Return False
            End If
 Else
            Return False
 End If

End Function
'pag NON BLOCKING; pwede mo i attach sa eventhandler kung may event yung class mo
'para pag natapos yung thread, mag trigger yung event



**note: sa notepad lang ako nagtype, so may syntax error to, pero itoi yung basic steps

@sir eric
what do you mean by BLOCKING THREAD...
gusto ko pag aralan to bat kulang ako sa fundamentals kaya yung iba di ko magets. I'm just finding a way how do what i want to do not knowing if its the correct metods to use. kung baga pag lumabas na yung gusto ko ok na yun. hehehehe

THREADING talaga gusto ko matutunan para di mukang naghahang yung application lalo na if there are queries that takes really long time to process... akala kasi ng users naka hang na kasi nakalagay NOT RESPONDING... heheheh
 
ahh...ask lang po master abawt sa simple calculator program....heres the problem..in subtaraction if the value of the second number is greater than the 1st number then the font & color will become red else use blue?
 
@sir eric
what do you mean by BLOCKING THREAD...
gusto ko pag aralan to bat kulang ako sa fundamentals kaya yung iba di ko magets. I'm just finding a way how do what i want to do not knowing if its the correct metods to use. kung baga pag lumabas na yung gusto ko ok na yun. hehehehe

THREADING talaga gusto ko matutunan para di mukang naghahang yung application lalo na if there are queries that takes really long time to process... akala kasi ng users naka hang na kasi nakalagay NOT RESPONDING... heheheh

BLOCKING === tatapusin muna yung thread bago ituloy yung next command sa main thread.
nagyayayri yan lalo sa mga devices like serial port since iisa lang ang kayang i process.

NON BLOCKING === tuloy lang ang ligaya habang tumatakbo ang isang thread sa background

remember yung main process mo; yung nag run sa start up; yun yung MAIN thread mo,
pwede ka mag SPAWN ng new thead mula dito then pwede mo rin i join afterwards.

since ang mga form controls nsa main thread, di sila pwede gamitin ng new thread mo
meaning di mo pwedeng tawagin ang textbox na gawa sa main thread from another thread, gagamitan mo ng DELEGATES pag ganun ang gusto mo gawin,
pero sa ibang kwento na ang delegates, try mo i search for the meantime

masaya mag aral ng multithreading....
http://www.codeproject.com/KB/vb/mutithreading_for_beginer.aspx
http://www.programmersheaven.com/2/Les_VBNET_14_p1
http://www.startvbdotnet.com/threading/default.aspx
 
ahh...ask lang po master abawt sa simple calculator program....heres the problem..in subtaraction if the value of the second number is greater than the 1st number then the font & color will become red else use blue?

sinabi mo na yug LOGIC,

if the value of the second number is greater than the 1st number then the font & color will become red else use blue


just transalate it into code

Code:
if num2 > num1 then
textbox1.forecolor = Color.Red
Else
textbox1.forecolor = Color.Pink
endif
malabo kung yung Font at backcolor parehas, wala ka na makikitang value nun.....
 
id0l eric patambay rin ako dito ha...

gus2 ko rin matuto ng vb.net

hehe..
 
mag install ka na ng visual studio express para matry mo mag code

meron na po idol..

example ka naman po kahit "hello word"..hehe
s0ri newbie palng poh eh :lol::lol:

gan2 rin po ba coding nun..

Private Sub Form_Load()
MsgBox ("hello world")
End
End Sub

vb6 p0 yan hehe..:lol::lol:
 
Nasa ibaba po yung program ko! Paki silip nalang.. Tzk3!
 

Attachments

  • Populate.rar
    150.9 KB · Views: 431
Nasa ibaba po yung program ko! Paki silip nalang.. Tzk3!

wala naman yung Setup.msi

saka sana ipakita mo kung papano mo ginawa, para naman maishare sa iba.....
 
meron na po idol..

example ka naman po kahit "hello word"..hehe
s0ri newbie palng poh eh :lol::lol:

gan2 rin po ba coding nun..

Private Sub Form_Load()
MsgBox ("hello world")
End
End Sub

vb6 p0 yan hehe..:lol::lol:
di mo ba nakita yung samples na nandito?
most of the forms has codes on Load Event, at may sample din ng messagebox.

nandun lahat, titignan at babasahin at iintindihin nalang

thats why madaming code yun para mapakinabangan
 
Back
Top Bottom