|
You're in luck then, this site provides ample opportunity to practice...
|
|
|
|
|
|
Hi ,
I liked the visualbasic powerpacks but i amnot able to use the shape controls like the other controls (in system.windows.forms ), when i am creating an instance of shape control and adding it to the picture box it is raising exception
"Value of type'Microsoft.VisualBasic.PowerPacks.RectangleShape' cannot be converted to 'System.Windows.Forms.Control'.
I want to use those controls like label,Tb,Checkbox and i want to add to the picturebox control .Is there any other way to create line,Rectangle ,oval and add to the picturebox .I reallly want these things in my application
DVS
|
|
|
|
|
Don't use a PictureBox control, try using a Panel instead. The PictureBox is one of the most abused and overused controls in the ToolBox by newbie's, right along side the TabControl.
I dont' have the powerpack here, but I've got it at work. I'll try it when I get there.
|
|
|
|
|
Thanks For Reply ,
But presently , i am creating controls like TB,RB,PBox,Grid labels ,etc on the picturebox at runtime .Like that i wanted to create the oval ,rectangle,line shapes . This way i have to create on picturebox as a base .Upto now everything is fine .Now i struck with these shapes .If they accept like other controls there is no problem .
In some way i have to create .
Vstudio team creates any type of control on the form .Like that i want to create all the type of controls on picturebox .
I have to find some solution ??
Pls help
Dvs
|
|
|
|
|
dvsriram wrote: But presently , i am creating controls like TB,RB,PBox,Grid labels ,etc on the picturebox at runtime
So what?? A PictureBox is used for displaying an image. You're not showing an Image, are you?
A Panel control is a container specifically designed to hold other controls.
OK. I looked into how the PowerPack shapes work. When you drop a shape on a form, there is a container control that is automatically created, called, oddly enough, ShapeContainer and is named, by default, ShapeContainer1. You have to add your shape controls to this container, or if you don't drop an initial shape on the form, you have to create the ShapeContainer instance yourself.
Example:
Imports Microsoft.VisualBasic.PowerPacks
.
.
.
Friend WithEvents myContainer As ShapeContainer
Private Sub Form1_Load(blah, blah) Handles Form1.Load
myContainer = New ShapeContainer()
With myContainer
.Location = New Point(0, 0)
.Dock = DockStyle.Fill
End With
Me.Controls.Add(myContainer)
Dim newShape As New LineShape(130, 5, 5, 150)
newShape.Parnet = myContainer
End Sub
...
|
|
|
|
|
Thanks , It got to work on panel ,picturebox ,But presently i changed from picturebox to panel
Dim ctr As ShapeContainer = New ShapeContainer()
Dim sh As RectangleShape = New RectangleShape(ctr)
sh.BorderColor = Color.Blue
sh.BorderStyle = Drawing2D.DashStyle.Solid
sh.BorderWidth = 3
sh.Left = ihorizontal
sh.Top = ivertical
sh.Width = 40
sh.Height = 50
cs.WireControl(ctr)
panelActiveCanvas.Controls.Add(ctr)
This cs class is used for control resizing ,moving
For this i used this one
http://www.codeproject.com/KB/miscctrl/CSPickBoxSample1.aspx?df=100&forumid=23756&exp=0&select=1266133&tid=1266133[^]
it is taking all controls & moving and resizing except the shape controls ,
While clicking on the rectangle it is selecting the panel but not getting the pickbox to resize ,moving
How can i get exactly like Visual studio powerpacks control drag & drop on form ?????
Dvs
|
|
|
|
|
If method to be invoked in thread is "callThread()"(without parameters)
we are following
Thread testThread=new Thread(Addressof callThread)
testThread.start()
But I want to the method which has some parameters
ex: callThread(ByVal s as string,ByVal i as integer)
{
}
how should i call this method using threading
Please advice me
Thanks in advance
Praveen Kumar Palla
|
|
|
|
|
praveenkumar palla wrote: how should i call this method using threading
That depends on which version of VB.NET you're using. 2002, 2003, 2005, or 2008??
|
|
|
|
|
thanks for the response
using
VB.Net 2005
|
|
|
|
|
i am creating a backup programme. My Question is that when i copy a folder to another location and if the folder is already exist then it should overwrites only those folders whose modifed date is older than today. so please tell me how can do this. Anyone have codes........
Thank you
Dharmendra
|
|
|
|
|
The easiest solution is to compare dates.
|
|
|
|
|
Hi,
I am using Crystal Reports with .NET 2.0 for generating reports in my project. My database is SQLSERVER 2000.
I want to display list of absentees between 2 given dates.
For this I have written a stored procedure like below.
CREATE procedure tesk4(@Fromdate DATETIME, @Todate DATETIME)
as
declare
@return BIT
WHILE @Fromdate <= @Todate
BEGIN
SET @Fromdate = @Fromdate + 1
if DATENAME(WEEKDAY, @Fromdate) IN ('saturday', 'sunday')
print'saturday'
else
if @Fromdate IN (select holdate from holidays )
print 'Holiday '
else
select card_no from carddata where card_no Not in(select card_no from swipes where sdate =@Fromdate)
END
GO
Now how call this procedure in report as it have parameters.
Pls help me with a solution for this problem
|
|
|
|
|
You can do it directly in CR but it's tricky and a pain.
Better insert a DataSet into your project and there add a TableAdapter for your stored Procedure (easy - you get an nice assistent).
After this add a crystal report document to your project and set it's database to this dataset.
Finally you only have to set the DataSource of the report to the DataTable returned by the DataAdapter before showing/printing.
|
|
|
|
|
Thanks a lot for your instant reply
I have no idea about Report Document.
Help me to get a clear idea on Report Document
otherwise
doing it directly in CR which you said Tricky
|
|
|
|
|
Hi,
We have a situation where we need to 'move' a file from one location to another. We are using the moveTo method of fileInfo class for this. But the issue with this is that when we execute it, the file, after it has been moved to the destination folder retains the previleges of the source folder whereas it should have gotten the previleges of the destination folder. copyTo method of the same object does not have this problem.
One alternative is to use the copyTo method and then delete method but that becomes a little risky and we do not want to go that route.
Any ideas how we could acheve 'moving' a file in VB.NET without using the fileInfo.moveTo()?
Responses will be greatly appreciated.
Thanks
sb_
|
|
|
|
|
Moving a file WILL retain the permissions set on it specifically. It will not retain what it inherited from it's parent folders.
Copying will avoid this situation since you're creating a new file in the new location. The new file will inherit all of the permissions of the destination's parent folders, subject to the user's security permissions too.
If you want to move the file without the permissions, you can copy the file to the new location, then delete the original.
|
|
|
|
|
Hi,
As the title says I need an code sample for direct connection between two devices (computers, or something else( in this case windows CE device)) when one of them connects to the other it directly sends some file (over the internet, using IP address and port) I have tried using TcpClient and tcpListener But I can't get it to work. my code:
The function that listens for a connection:
Const portNumber As Integer = 8000
Dim tcpListener As New TcpListener(portNumber)
tcpListener.Start()
Console.WriteLine("Waiting for connection...")
Try
'Accept the pending client connection and return a Tcplient initialized for communication.
Dim tcpClient As TcpClient = tcpListener.AcceptTcpClient
Console.WriteLine("Connection accepted.")
' Get the stream
Dim networkStream As NetworkStream = tcpClient.GetStream()
' Read the stream into a byte array
Dim bytes(tcpClient.ReceiveBufferSize) As Byte
networkStream.Read(bytes, 0, CInt(tcpClient.ReceiveBufferSize))
' Return the data received from the client to the console.
Dim clientdata As String = Encoding.ASCII.GetString(bytes)
Console.WriteLine(("Client sent: " + clientdata))
Dim responseString As String = "Connected to server."
Dim sendBytes As [Byte]() = Encoding.ASCII.GetBytes(responseString)
networkStream.Write(sendBytes, 0, sendBytes.Length)
Console.WriteLine(("Message Sent /> : " + responseString))
'Any communication with the remote client using the TcpClient can go here.
'Close TcpListener and TcpClient.
tcpClient.Close()
tcpListener.Stop()
Console.WriteLine("exit")
Catch e As Exception
Console.WriteLine(e.ToString())
End Try
The function that connects to the other device and sends the file:
Dim tcp As New System.Net.Sockets.TcpClient()
tcp.Connect(Me.tcpIPAdresa, Me.brojPorta)
Dim nStream As NetworkStream = tcp.GetStream
If nStream.CanRead And nStream.CanWrite Then
Dim sendBytes() As Byte = Encoding.ASCII.GetBytes("microstar")
nStream.Write(sendBytes, 0, sendBytes.Length)
Dim bytes(tcp.ReceiveBufferSize) As Byte
nStream.Read(bytes, 0, CInt(tcp.ReceiveBufferSize))
Return True
Else
If Not nStream.CanRead Then
MsgBox("error cannot write")
tcp.Close()
Return False
Else
If Not nStream.CanWrite Then
MsgBox("error: cannot read data from the stream")
tcp.Close()
Return False
End If
End If
End If
Any ideas, code samples, anything.
Help greatly appreciated!
|
|
|
|
|
Fist: do you get the "Connection accepted" message?
If not your "Me.tcpIPAdresa" of "Me.brojPorta" might be wrong.
Second: please state what you've allready tried, what your steps where, test runs etc. - just posting a (not stand-alone) codeblock and beging for help will not work without further info.
Examples you will find in the MSDN documentation to TcpListener
|
|
|
|
|
Hello,
I am trying to come up with a way of securing controls inside of a VB.NET 2005 application (Window form). I have searched and found information but the resources seems to be all based on ASP.NET (Codeproject's article are also not useful enough, like http://www.codeproject.com/KB/vb/2gs_txtbx.aspx#add[^])
I have created database to store values for username and password. I have already did a user login which verify the username and password. I want to have two level levels of security. One that has limited access to certain forms(users) and another that has full access(admin). I want one user to be able to access a screen with controls such as data grid view but not be able to edit them. Is there any good concepts out there on how to manage this efficiently? Any help would be greatly appreciated.
Thanks,
telly
|
|
|
|
|
I tried to declare functions of DLL file in project directory with VB 2005/2008. However, I need to specify file path of DLL. Otherwise, VB cannot find DLL file when calling the function. Is there any other way I can make project directory default when loading DLL?
Current code:
Public Declare Auto Function CmodConnect Lib "C:\Visual Studio 2008\Projects\Cmod\Cmod.dll" _
(ByVal Address As Integer) As Boolean
Change to:
Public Declare Auto Function CmodConnect Lib "Cmod.dll" _
(ByVal Address As Integer) As Boolean
|
|
|
|
|
ADd the path to the PATH variable on your computer. But, really, the dll should just be local, that's the best way to do it.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
The DLL file is not a COM or assembly component. Thus, I could not use "Add Reference". The PATH might cause problem when moving to other computers. Is there other way to force VB to link the DLL file?
Thank you,
Steven
|
|
|
|
|
bj93081 wrote: The PATH might cause problem when moving to other computers
Absolutely - for deployment, the dll needs to be in the same folder as the exe, or a subfolder which you specify. That's kind of why I said that's the best way to go. Why would you want to put it elsewhere ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hi,
i use windows application I want validation to create texbox write arabic only
please send to me a sa
mple code
Ahmed hassan
|
|
|
|