|
Can anyone point me in the right direction to adding a checkbox to the ListView results that are generated using ExpTreeLib, what I would like to do is have the directory listing appear in the listview control and have a checkbox next to each entry that will add the path to an array if the checkbox is checked and remove it if it is unchecked.
Any ideas?
|
|
|
|
|
U can use foreach loop to loop over all the items of Grid Control and can find the Checked Items in the list. Or other way to of doing this is use Tree view control.
Regards,
Amit Kumar
HDISM, PGDCA, MCP, MCAD, MCSD
amit_chikara2002@hotmail.com
|
|
|
|
|
Is there a VB.NET equivalent syntax to this C# code?
public class FooBase
{
public FooBase ()
{
}
}
public class Foo : FooBase
{
public Foo () : base ()
{
}
}
Edit: So there's MyBase.New(), but is that it?
|
|
|
|
|
Public Class FooBase
Public Sub New()
' do something
End Sub
End Class
Public Class Foo
Inherits FooBase
Public Sub New()
' Call the base class constructor...
MyBase.New()
' do something
End Sub
End Class
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I was hoping there was something like the Constructor() : base () syntax, but I guess MyBase.New() will have to do.
Thanks for the response.
|
|
|
|
|
Hi All,
I wrote a program in vb.net and it runs perfectly on my local machine but not on network drives. The following is the error message I got when I run on network drive:
"Request for the permission of type 'System.Data.Odbc.Odbc:Permission, System.Data, Version=2.0, Culture=neutral,PublicKeyToken=b77a5c561934e089' failed"
After I make some research I found following link:
http://blogs.msdn.com/shawnfa/archive/2003/06/20/57023.aspx[^]
Based on info at about link, I
1) run sn.exe in command prompt like : sn -k "r:\myprog\debug\mykey.snk"
2) opened AssemblyInfo.vb and added : <assembly: assemblykeyfile("r:\apps\tools\roscoe="" 4.0\subs\roscoekey.snk")="">
3) run progam and I got another error message saying "Unable to emit assembly: Referenced assembly 'MyLib' does not have a strong name"
MyLib is C-Sharp class library.
4) So i added AssemblyKeyFile: in AssemblyInfo.cs
5) when i run program I got other error messages saying
- "Assembly generation failed -- Referenced assembly 'Interop.Word' does not have a strong name"
- "Assembly generation failed -- Referenced assembly 'Interop.Excel' does not have a strong name"
- etc......
What do I need to do inorder to run my program on network drives like I could run on my local drives.
Thank You.
|
|
|
|
|
A network, any network, is not a trusted source for executable code. I suggest you read up on Code Access Security[^]. And, what's new[^] for CAS in the .NET Framework 2.0.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I would like to build a datagrid from a directory of text files. How do I get the files from the directory into the datagrid?
Thank you,
Silver-grey
silver-gray
|
|
|
|
|
Why would you want to use such a heavy-weight control to display a list of filenames?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Because that is the User Specs. If you don't know a way to get the files in the directory and write them to another file name, Please don't comment. I thought that this was to help!! with the question:
silver-gray
|
|
|
|
|
Silver-Grey wrote: If you don't know a way to get the files in the directory and write them to another file name, Please don't comment.
OK, smart-ass...I just thought I would find out why the heavy wieght control needs to be used before I put the effort into commenting. Normally, a ListView is used for showing a list of filenames. Using a DataGrid for this is pretty odd, customer spec or no. I thought, "maybe this guy is a noobie and doesn't know any better. Let's find out first..."
Well, here's one way to do it...
Dim files As String() = Directory.GetFiles(directoryPath)
DataGridView1.Columns.Add( New DataGridViewTextBoxColumn() )
For Each f As String in files
Dim fa As String() = {f}
DataGridView1.Rows.Add(fa)
Next
This is probably not the best way to do it, but hey. I work out the specs with the customer and don't let them make the mistake of dictating them to me. You're supposed to work with the customer to come up with a proper solution, not for the customer.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I don't have a datagridview in tool box. Using 2003 Visual Studio
silver-gray
|
|
|
|
|
Great! More stuff I'm supposed to know without you explaining...
Let's see, my old .NET 1.x DataGrid is a bit rusty, but...
Dim files As String() = Directory.GetFiles(directoryPath)
Dim fa As New ArrayList()
fa.AddRange(files)
DataGrid1.DataSource = fa
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
That didn't work. I guess I will have to use a listbox. I can get data inti it. Now trying to select data out of it and write a new file with a different name.
Silver-grey
silver-gray
|
|
|
|
|
Could somebody tell me how to convert a string (0 to 255 range) to a byte array?
William
|
|
|
|
|
Use the encoding of your choise and the GetBytes method:
messageArray = Encoding.ASCII.GetBytes("Hello world")
---
b { font-weight: normal; }
|
|
|
|
|
Hi,
Thank you very much for help. Your code just works for ASCII characters. What about the characters in the range from 0 to 255??
Thank you again,
William
William
|
|
|
|
|
That's why I said that you should choose an encoding. Use the encoding that was used to create the string.
---
b { font-weight: normal; }
|
|
|
|
|
Dim textConverter As New System.Text.UTF8Encoding
Dim bytes() As Byte = textConverter.GetBytes("Text to convert")
Alexei Rodriguez
|
|
|
|
|
hii i am kannan.currently im working with a project in VB.Net. the project is, i've to create a reader for pdf files.the reader uploading a pdf file and user can read it like a real magazine. and we know we are flipping/turns each page of a real magazine to go for the next/Previous page. I WANT THE SAME PAGE FLIP EFFECT IN MY PROJECT.i heard that directx + vb.net wil gimme a solution.
you can see an example reader at www.zinio.com, its free for download. i need the same effect in my project. I have a components that converts each page of a pdf file to image file, which then i need to animate. Can you suggest me some idea. Is it possible using directx.
if anyone have experince in Directx + .net, lemme know it
|
|
|
|
|
Hi friends,
One problem i am stuck in please try to help.
I want to create a code where, when user clicks one row of the datagrid filled with data, the particular column value for e.g. the value of second column of the selected row should be visible on the text field present on the same form after a click of a button.
The sequence will be
1. First user click and selects one row
2. Then clicks a particular button
3. As click event is fired the value present in the second column of the selected row displays in the textbox present on the same form.
Try helping out please.
Nikhil Bandekar
Mumbai,
India
|
|
|
|
|
hi
is this windows or web application ??
Tamimi - Code
|
|
|
|
|
it is windows vb.net
i refered to the code u had given for hasan, regarding datagrid. I hope you would try to help me even. It seems you have good knowledge woking with datagrid
Nikhil Bandekar
Mumbai,
India
|
|
|
|
|
hi
put this line
TextBox1.Text = DataGrid1(DataGrid1.CurrentCell.RowNumber, 1)
on CurrentCellChanged event for thr datagrid or
on any button click
Tamimi - Code
|
|
|
|
|
hiii
Thanks a lots it worked out... I was struggling from when.
Thanks again for the favor.
Bye
Take Care
Nikhil Bandekar
Mumbai,
India
|
|
|
|