|
hi guys,
I have a label where data is outputed into it. I want to know how you are able to print that data out or send it to the printer when like a user clicks on a button called "print".
thanks
|
|
|
|
|
I have an aray of items I imported from an exteranl data source. Is it possible to turn the data into a typed dataset so I can sort and work with it in a datagrid?
|
|
|
|
|
hi,
I placed a combobox in datagird, it is displaying the data, but when i click in the new cell also it is displaying the combobox, but when i select the value from the combobox, that value is not storing in the current cell. when u click in someother cell that cell is going to be blank. but in the cell where already having the value if u click, it is showing the combobox, and even if we select another value that value is storing in the cell. and even i want to add a new value to the combobox.
pls tell me,
it is very urgent.
Thanks in advance.
Thiru.
|
|
|
|
|
What?
Is this an ASP.NET datagrid or a Windows Form datagrid?
Start again with the combobox. How are you placing it in a datagrid? how are you loading the combobox items? How are you loading the datagrid?What is the new cell that is also displaying the combobox?What is your goal for the grid and having the combobox? Are you getting errors? Show some error messages or some code?
|
|
|
|
|
sorry it is a windows form datagrid. retrieving data from sql server. i placed combobox in datagrid. the data which is backend from one of the field is displaying in combobox, but when i am adding new row in grid, it is not placing the value in grid from combobox. and even i want to add new value in the combobox. It is not giving any error.
Thank you for trying,
bye
|
|
|
|
|
there's error, "Wrong protocol or connection state for the requested transaction or request - Error number: 40006" --the failed line is Winsock1.SendData (Txtinput.Text)-- can u give me a hint Thank you
|
|
|
|
|
Without more information, like what version of VB your using, or even the code that is setting up and opening the connection, it's impossible to tell you, with any certainty, what's wrong.
But, on the assumption your using VB6, I'll point you at PRB: SendData Method Generates Error 40006[^] on MSDN. It's probably what your doing wrong.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi all,
trying to understand classes but come up with this problem
'how can i access this class, without putting a timer of the form, i.e the control has its own timer
Private Class clock
Inherits Timer
PublicFunction systemtime()
If Me.Enabled = FalseThen ' enable timer if not already
Me.Interval = 500 ' 1/2 secs
Me.Enabled = True
EndIf
systemtime = Now.Second 'get system second, cant be anthing just example.
EndFunction
PrivateSub Test_Tick(ByVal sender AsObject, ByVal e As System.EventArgs) HandlesMyBase.Tick ' on tick run the function
systemtime()
End Sub
End Class
Friend Class Count
Dim test As New clock
Dim timer1 As New clock
Public Function displaytime() As String
displaytime = timer1.systemtime
End Function
End Class
PrivateSub Form1_Load(ByVal sender AsObject, ByVal e As System.EventArgs) HandlesMyBase.Load
Dim test As New Count
'********* problem here************
'because this is only run once
Label1.Text = test.displaytime() 'this only happens once
End Sub
EndClass
'is there a way of running this class and passing the data to the label withing the timer class?
Happy Xmas to all!
From
Shortcircuit Software!
|
|
|
|
|
You need to have an event that is fired by your class when the time changes or whatever it is you want to display, the form can then handle this and update the label:
Public Event UpdateTime As EventHandler
So to fire the event:
Protected Overrides Sub OnTick(e As EventArgs)
Me.SystemTime
'Some sort of test to see if you want to fire the event
If IsChristmas Then
RaiseEvent UpdateTime(me, EventArgs.Empty)
End If
End Sub Then in on the form:
Private Sub Clock_UpdateTime(e as EventArgs, sender as Object) Handles Clock.UpdateTime
Label1.Text = Clock.DisplayTime
End Sub
Hope this helps
Tom
|
|
|
|
|
Thanks for your help, i needed further info but you lead me in the right direction
i came up with this.... (this works!).....
Private WithEvents timer As Clock = New Clock
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Label1.Text = timer.systemtime
End Sub
Private Sub timer_UpdateTime(ByVal sender As Object, ByVal e As System.EventArgs) Handles timer.Tick
Label1.Text = timer.systemtime
End Sub
Public Class Clock
Inherits timer
Public Event UpdateTime As EventHandler
Private Sub Test_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Tick
systemtime()
End Sub
Public Function systemtime()
If Me.Enabled = False Then
Me.Interval = 125
Me.Enabled = True
End If
systemtime = Now.Second
RaiseEvent UpdateTime(Me, EventArgs.Empty)
End Function
End Class
Thank you and have a Merry Xmas
Andy
|
|
|
|
|
i need to control 2 cmdbuttons between 2 Lan-PC . Can u give me some advices plz such as Tool , Component or Code . Thx
|
|
|
|
|
i need to control 2 cmdbuttons between 2 Lan-PC . Can u give me some advices plz such as Tool , Component or Code . Thx
|
|
|
|
|
You going to have to be alot more descriptive than that. What do you mean by "control"? Are you saying that you want one PC to click on button on another PC?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i mean ,if the cmdbutton on my computer clicked ,it would affect to the cmdbutton on your computer , which component should i use ? can u give me some advise .
|
|
|
|
|
There isn't any one component. It's not a simple matter of sending a little message to the other machine. You're talking about writing your own little version of PCAnywhere. You'll need to write a server piece, which runs on the computer you want to control, and a client that will run on your machine. Basically, begin researching VNC clients. Search the comments in the VB and C# Forums and you'll come up with lots of mentions and links to some good VNC libraries that you can use.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am building a simple FTP client with download feature. How can i authenticate myself after providing parameters on the FTP server. This the Log In code but the problem is that it is not authenticating me.
Public Function LogIn() As Boolean
m_objClientSocket = New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)
Dim Ep As IPEndPoint = New IPEndPoint(Dns.Resolve(m_strRemoteHost).AddressList(0), m_intRemotePort)
Try
m_objClientSocket.Connect(Ep)
Catch ex As Exception
MessageString = m_strReply
Throw New IOException("Cannot connect to the Remote Server")
End Try
ReadReply()
If (m_intRetValue <> 220) Then
CloseConnection()
MessageString = m_strReply
Throw New IOException(m_strReply.Substring(4))
End If
SendCommand("USER " & m_strRemoteUser)
If (Not (m_intRetValue = 331 Or m_intRetValue = 202)) Then
CleanUp()
MessageString = m_strReply
Throw New IOException(m_strReply.Substring(4))
End If
If (m_intRetValue <> 230) Then
SendCommand("PASS " & m_strRemoteUser)
If (Not (m_intRetValue = 230 Or m_intRetValue = 202)) Then
CleanUp()
MessageString = m_strReply
Throw New IOException(m_strReply.Substring(4))
End If
End If
m_blnLoggedIn = True
ChangeDirectory(m_strRemotePath)
Return m_blnLoggedIn
End Function
|
|
|
|
|
I am having trouble writing data to my xml file. I already have a StreamReader that reads the data, but when I use StreamWriter to write the data back out to the file, it writes data, but it writes blank data. It clears my file so the next time I try to run my program an error message says it can't find the origional table that was in my file before, of course thats because it isn't there now. any suggestions on what I may be doing wrong? I am writing from a form with a datagrid.
HAPPY HOLIDAYS
|
|
|
|
|
You are probably not closing the file properly after you have written to it. Have a look at the DataSet.ReadXml and DataSet.WriteXml on MSDN, both have examples of how to code it properly:
DataSet.ReadXml - MSDN[^]
DataSet.WriteXml - MSDN[^]
Hope this helps
Tom
|
|
|
|
|
How to know the functions decleared in unknown dll file of some other software
|
|
|
|
|
You might want to look into PE Explorer, here[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I would like to ask how can i retrieve data from the selected row of the Datagrid.
Thank you.
|
|
|
|
|
|
DataGrid1.SelectedItem.Cells(0).Text
(First Column Value From Selected Row)
'Cause I'm living on things that excite me, be it pastries or lobsters or love... I'm just trying to get by, being quiet and shy, in a world full of push and shove...
Jimmy Buffett - The Wino and I know
|
|
|
|
|
I have a vb6 app with no forms that is run in dos window. How do I output to the window if I want to send a message. No Msgbox (I don't want things popping up)
so I want something like this
c:\ingroup
c:\You must provide a parameter with ingroupc
c:\Example ingroup /i
Something like that if possible?
thanks
|
|
|
|
|
VB6 couldn't target a console app. You have to call into the Win32 API to create a console and output to it. You might want to try here[^] for a couple of console classes for VB6.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|