Προς το περιεχόμενο

Erotisi gia ena problimataki sth visual basic


Exoskeletor

Προτεινόμενες αναρτήσεις

Δημοσ.

guys thelo na sas rotiso 2 pragmatakia:

pos mporo na fortoso exe arxeia sthn visual basic?me poia entolh?pos mporo na balo parametrous sta exe? (px nomiza pos tha htan load "c:\akis.exe /list")

pos mporo molis patao se ena koumpi apo mia forma na pigenei se mia allh?

na antikathista thn proti omos,opos ena aplo programa otan patas next pou se pigenei se allh eikona

  • Απαντ. 55
  • Δημ.
  • Τελ. απάντηση
Δημοσ.

8ewrwntas oti oles oi formes anhkoun sto idio programma, exoume kai leme:

a)an to koumpi pou patas einai panw se mia forma mporeis na xrhsimopoihseis tis getfocus kai setfocus (an 8ymamai kala) me8odous ths ka8e formas.

b)an me thn leksh koumpi ennoeis kapoio plhktro tote xrhsimopoihse to keypress (h kapws etsi--den exw vb mprosta mou ;) ) kai sygkrine me ton ascii number tou pliktrou pou 8es ( prosoxh dwse sthn diafora kefalaiwn mikrwn).

 

Afou etsi h efarmogh sou katalabei to koumpi vale sto click event tou koumpiou sou unload Me kai sto unload event ths formas pou 8es na diwkseis vale load thn epomenh.Vevaia ap'oti katalava 8a xreiastei na pernas kapoies parametrous anamesa stis formes.

 

H entolh pou 8es gia na trexei kati p.x. c:\akis.exe /list einai h shell. Sto msdn exei analytiko paradeigma.

Δημοσ.

enoo friend koumpi pano se forma.tis getfocus/setfocus entoles pos ths xrisimopoio?

brika kai ena allo tropo na anigi forma me to:

load form1

form1.show

alla to anigi se allo simio thn forma.ego thelo pano sthn allh.

 

to shell to brika kiego

exo ena problimataki thelo na trexei ayto:

x=123

shell "c:/cdrecord.exe -devx -format"

alla anti gia x na bazei enan arithmo pou alazei.pos tha ginei ayto friend?giati etsi anti gia ton arithmo to pernei san x..

Δημοσ.

Oi getfocus/setfocus den einai entoles,einai me8odoi pou yparxoun sta diafora objects.

To msdn exei analytika paradeigmata.

Se opoio antikeimeno kaneis onoma_antikeimenou.setfocus erxetai sto proskinio.

 

Gia na anoigei h forma sto shmeio pou 8es allakse ta attributes left kai top se sxesh me thn allh sou forma,prin kaneis form1.show dhl:

 

>
load form1
form1.left=prohgoumenh_forma.left+prohgoumenh_forma.width/2
form1.top=prohgoumenh_forma.left+prohgoumenh_forma.height/2
form1.show

 

H shell kaleitai me orisma mia metavlhth typou string.

O kwdikas sou prepei na nai kati tetoio:

 

>
Dim s as string
x=123 
shell "c:/cdrecord.exe -dev" & cstr(x) & " -format" 

 

H cstr kanei ena expression cast se string.

 

Elpizw na voi8isa.

Δημοσ.

fisika kai boithises friend.de mou les. giati na grapso: Dim s as string?

mipos enoouses Dim x as string

 

1) akoma kai otan kano ayto pou mou les me to load form, an alaksis thn thesh ths protis formas,h deyterh tha emfanisth sth thesh ths protis..ego thelo opou pigeneis thn mia forma kai oi epomenes na menoun sto idio shmeio.ginete ayto?

 

2) kati allo pou eine ligaki diskolo..

iparxei kapoio programa pou na mou leei ta scsibus gia kathe siskeyh?

px na mporo ean epilekso e:(kai to scsibus tou e: an eine 1,0,0) na balei sto x to 1,0,0

diskolo to blepo ayto..

 

3) iparxei kapoios tropos otan trexo arxeia exe me to shell kai eine dos molis kanoun oti exoun na kanoun na mhn kleinoun apo mona tous alla na prepei na patisis enter gia na kleisoun?

 

4) exo ena problimataki me ena DirListBox..to epilego gia na kano copy kati arxeia alla ayto ta kani copy ston proigoumeno fakelo apo ayton pou epilego. (px. epilego ton fakelo c:\dir1\dir2\ kai ayto kani ta arxeia copy sto c:\dir1\)

o kodikas eine aytos:

 

Dim sSourceDir As String

Dim sBackDir As String

Dim sNextFile As String

 

sSourceDir = "c:\akis\"

sBackDir = Dir1

 

sNextFile = Dir$(sSourceDir)

 

While sNextFile <> ""

FileCopy sSourceDir & sNextFile, sBackDir & sNextFile

sNextFile = Dir$

Wend

 

epilego gia dir1 ton c:\dir1\dir2\ kai mou ta kanei copy ston c:\dir1\ :(

Δημοσ.

nomizo oti den xreiazontai diaforetikes formes efoson theleis ena parathyro san thn kyria efarmogh.aplos mporeis na baleis ta components soy pano se dyo diaforetika panels kai meta na paizeis me to property Visible = {true h false} gia to kathe panel. Apofasizontas poio tha fainetai kai poio oxi

Δημοσ.

des to parakato paradeigma gia to pos orizeis ena panel kai prostheteis controls se ayto

 

>
Public Sub CreateMyPanel()
   Dim panel1 As New Panel()
   Dim textBox1 As New TextBox()
   Dim label1 As New Label()
   
   ' Initialize the Panel control.
   panel1.Location = New Point(56, 72)
   panel1.Size = New Size(264, 152)
   ' Set the Borderstyle for the Panel to three-dimensional.
   panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
   
   ' Initialize the Label and TextBox controls.
   label1.Location = New Point(16, 16)
   label1.Text = "label1"
   label1.Size = New Size(104, 16)
   textBox1.Location = New Point(16, 32)
   textBox1.Text = ""
   textBox1.Size = New Size(152, 20)
   
   ' Add the Panel control to the form.
   Me.Controls.Add(panel1)
   ' Add the Label and TextBox controls to the Panel.
   panel1.Controls.Add(label1)
   panel1.Controls.Add(textBox1)
End Sub

Δημοσ.

Dim s as string: My bad.... :D :D :D Allo skeftomouna......

 

1) akoma kai otan kano ayto pou mou les me to load form, an alaksis thn thesh ths protis formas,h deyterh tha emfanisth sth thesh ths protis..ego thelo opou pigeneis thn mia forma kai oi epomenes na menoun sto idio shmeio.ginete ayto?

Anti gia kati pou na exei sxesh me thn forma vale opou prohgoumenh_forma to screen object (einai h o8onh)

 

2) kati allo pou eine ligaki diskolo..

iparxei kapoio programa pou na mou leei ta scsibus gia kathe siskeyh?

px na mporo ean epilekso e:(kai to scsibus tou e: an eine 1,0,0) na balei sto x to 1,0,0

diskolo to blepo ayto..

den kserw 8a to psaksw to apogevma pou 8a xw pio poly xrono kai 8a sou pw alla prepei na ginetai.

 

3) iparxei kapoios tropos otan trexo arxeia exe me to shell kai eine dos molis kanoun oti exoun na kanoun na mhn kleinoun apo mona tous alla na prepei na patisis enter gia na kleisoun?

trekse thn entolh shell "c:/cdrecord.exe -dev" & cstr(x) & " -format & pause" .

To & pause pou pros8eteis sou vgazei prompt "press any key to continue" prin kleisei to console window .

 

4) exo ena problimataki me ena DirListBox..to epilego gia na kano copy kati arxeia alla ayto ta kani copy ston proigoumeno fakelo apo ayton pou epilego. (px. epilego ton fakelo c:\dir1\dir2\ kai ayto kani ta arxeia copy sto c:\dir1\)

o kodikas eine aytos:

 

Dim sSourceDir As String

Dim sBackDir As String

Dim sNextFile As String

 

sSourceDir = "c:\akis\"

sBackDir = Dir1

 

sNextFile = Dir$(sSourceDir)

 

While sNextFile <> ""

FileCopy sSourceDir & sNextFile, sBackDir & sNextFile

sNextFile = Dir$

Wend

 

epilego gia dir1 ton c:\dir1\dir2\ kai mou ta kanei copy ston c:\dir1\

Dokimase na paikseis me to property path tou dirlistbox sou

Δημοσ.

boris an omos kounisis thn mia forma kai patisis na emfanisti h deyterh tha emfanisti se allo shmeio.ego thelo na emfanizete sto shmeio pou htan h proth

 

 

1) "Anti gia kati pou na exei sxesh me thn forma vale opou prohgoumenh_forma to screen object (einai h o8onh)"

ti enoeis?den katalaba.mhn ta les kiesy toso apotoma.eime neos sthn visual :)

ti akribos na graso ego?

Load Form2

Form2.Show

Form1.Left = screen object

Form1.Top = screen object

ayto den nomizo pantos :)

 

2) pos mporo otan patao se ena koumpi (ths formas) na emfanizete ena txt arxeio mesa se ena txtbox?

Δημοσ.

screen object?? ti einai ayto?? den to exo akoysei pote!!

 

An theleis na to kaneis eykola ayto, apla kane tis formes Movable=False kai bale tis na arxizoyn apo centerscreen. Meta bgenei ok me ton kodika

 

Form2.show

Unload Me

 

An thes anagkastika na einai movable prepei na to psakso perisotero... Thes na koitakso an bro kanena tropo kai na soy po, i' den se peirazei an den mporeis na tis kinisis??

Αρχειοθετημένο

Αυτό το θέμα έχει αρχειοθετηθεί και είναι κλειστό για περαιτέρω απαντήσεις.

  • Δημιουργία νέου...