|
so when i use this listbox, can i have each line in the box goto a different file?
Exactly. Each line of the 'list' would show something like:
1----------------1/\
1c-standards.pdf 1*1
1vb_reference.pdf1 1
1my_book1.pdf 1 1
1etc.pdf 1 1
1-----------------\/
And when you 'Dbl_Click()' on any item (...with the code I showed you) you´ll exec every file to launch the default pdf reader and show it to the user. neat
Pablo.Ar
PS:any other doubts?
|
|
|
|
|
Is there an easy way to clear multiple controls?
Fore example; I have 20 textBoxes, 10 radioButtons and 5 checkBoxes in a form. Is there a single command that will set ALL:
textbox.text = ""<br />
radioButton.checked = False<br />
checkbox.checked = False
Thanks
Brad
|
|
|
|
|
No, there isn't. You'll have to create a function that enumerates and clears them, one by one.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I think you could use control array to do that, for example:
dim i as integer
dim j as integer
dim k as integer
for i=0 to 19
txt(i).text=""
next
for j=0 to 9
rdb(j).checked=false
next
for k=0 to 4
chk(k).checked = false
next
Roath Kanel
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
There are no control arrays in VB.NET like there were in VB6. You have to enumerate the form's Controls collection to get at them.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Anybody know how to add icons to listview columnheaders? I tried and I did not know how.
|
|
|
|
|
Ok, this is a pretty complex and long one...
*) First of all you need to add an 'ImageList' control to your project, and insert the images that are going to be icons on the listview.
*) After you´re done with that, go to the listview´s property page and go to the 'Image Lists' tab. Set the appropiate 'ImageLists' to each option.
*) On the code:
Listview1.ListItems.Add , , "Hello!", <image_index_corresponding_to_the_imagelist_of_big_icons>,<image_index_corresponding_to_the_imagelist_of_small_incons>
*) Columnheaders: At the listview´s property page, in the 'Column Headers' tab, you have a textbox to set the 'Icon Index', wich also corresponds to the index of the image in the actual imagelist.
Was this clear enough?
Pablo.Ar
|
|
|
|
|
Hey
I know this has gotta be simple
PrintDocument1.PrinterSettings.PrintToFile = True
PrintDocument1.Print()
I want to either set the file to have it print to, or get the file name that was typed in.
Thanks in advance
|
|
|
|
|
All your doing by setting .PrintToFIle to Ture is enabling the little check box on the dialog that allows the user to select printing to a file. The only way your going to be able to get a filename to print to is to build a dialog yourself or use a SaveDialog. Then you'll have to handle outputting the text to the file. You can't "print" to the filename you get.
Unfortunately, the Print To File functionality doesn't work. I'm hoping it'll be fixed in the next service pack for the .NET Framework, if not in .NET 2.0.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi
i want to know how to display a computer IP
there is a thread that mention this before and i have try the coding posted
im not sure what i did wrong but i cant display anything
im using VB6 and VB.net so either code will be fine for me
thank you in advance
Gary
|
|
|
|
|
You'll have to use WMI and the System.Management namespace to get the all the IP addresses that all the NIC in the machine are using. I can't give you any sample code right now because I just don't have the time.
What was the link to the previous article with the code that you are using?
If you post code, make sure you put it between <pre> and </pre> tags. Also, make sure that you check the little box at the bottom of the message post window that says "Do not treat <'s as HTML tags."
<i><b>RageInTheMachine9532</b></i><font size="-1">
"<i>...a pungent, ghastly, stinky piece of cheese!</i>" <b>-- The Roaming Gnome</b></font>
|
|
|
|
|
Hello,
I have win2k SP4 and I need to use some com server from VC++ and VBA6. In C++ I can use sequence like this to get pointer on interface Intrfc1 from ISrvr object:
ISrvr* pSrvr = NULL;
IIntrfc1* pIntrfc1 = NULL;
::CoCreateInstance(CLSID_Srvr, NULL, CLSCTX_ALL, IID_ISrvr, (void **)&pSrvr);
pSrvr->QueryInterface(IID_ IIntrfc1, (void**)& pIntrfc1);
In VBA 6.3 (Excel) I can go to the menu tools->References, include library in to the VBA project and create the instance:
Dim Srvr As ISrvr
Set Awg = CreateObject("LIBNAME.ISrvr")
How to get Intrfc1 object from Srvr? It should be some analog of QueryInterface in VBA. Unfortunately VB6 sequence
Dim Intrfc As IIntrfc1
Set Intrfc = Srv.Object
doesn’t work in VBA6.3. What do I need to do in VBA6.3?
Thanks for help
Leon
|
|
|
|
|
Hi,
I have a byte array of data that I store in to a Queue for processing reasons. But for some strange reason half of the data I put in the Queue (exactly the last half, actually, everytime!) dequeue as nulls (0x00). The sample output below shows the problem I'm having. The first two lines are a hex dump of my "input" byte array. The next line, "CreateQueue() done" tells me that the Queue was create and has the same size as the byte array (as it should). But in my double check you can see how the last 16 bytes are all null. Anybody know what's going on? Thx, Matt
-----------------------------------------------------------------
0000: ad 00 14 00 04 02 00 00 0a 4f 70 65 6e 53 65 72
0010: 76 65 72 05 00 00 00 fd 00 00 00 00 00 00 00 00
CreateQueue() done. matt=32, queue count=32
double check:
0000: ad 00 14 00 04 02 00 00 0a 4f 70 65 6e 53 65 72
0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Here's the code that populates the Queue from the byte array:
foreach(byte b in Pdu.Payload)
{
m_qPayload.Enqueue((byte)b);
}
|
|
|
|
|
Hi,
I have some Problem Accessing dynamically created controls in VB.Net. Actually what I have to do is
I have to get different set of questiond based on the order type.
For example , OrderType A may have 5 questions . It can be a short text, Long Text or a multiple choice question and
OrderType B may have 3 questions of different Type.
I have to create different control(textbox, multi line textbox, radioButton) based on the que type.
I am adding all the controls to a table and the table to a placeholder.
I don't have any problem creating the questions and controls dynamically.
But the problem bubble up when i try to access the dynamically created control.
I am creating the control in the Page_Init
and I am trying to get the response from those dynamically created control once the user click on the submit button.
Here is the code:
PrivateSub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Init
Dim mytable AsNew Table
Dim que As DataTable
Dim qrow As DataRow
Dim row AsInteger
IfNot IsPostBack Then
Dim myorderid = CInt(1)
Dim myaccount As DNS.OrdersDB = New DNS.OrdersDB
myserviceid = myaccount.GetServiceType(myorderid)
que = New DataTable
que = DNS.QADB.GetQuestions(myserviceid).Tables(0)
row = CInt(que.Rows.Count)
Dim i AsInteger
For i = 0 To row - 1
qrow = que.Rows(i)
Dim mytype AsString = qrow("QueType")
Dim myreq AsString = qrow("QueRequired")
If mytype = "SHORT TEXT" Then
Dim myrow AsNew TableRow
Dim myrow1 AsNew TableRow
Dim mycell AsNew TableCell
Dim mycell1 AsNew TableCell
Dim lbl As Label = New Label
lbl.Text = qrow("QueName")
Dim mylblid AsString = "lbl" + CStr(qrow("Queid"))
lbl.ID = mylblid
Dim txt As TextBox = New TextBox
txt.ID = qrow("Queid").ToString()
txt.Width = Unit.Pixel(Convert.ToInt32(200).ToString())
mycell.Controls.Add(lbl)
mycell1.Controls.Add(txt)
myrow.Cells.Add(mycell)
myrow1.Cells.Add(mycell1)
mytable.Rows.Add(myrow)
mytable.Rows.Add(myrow1)
ElseIf (mytype = "LONG TEXT") Then
' as added above
End If
Next
myplace.Controls.Add(mytable)
EndIf
EndSub
Private Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
Dim mytable As New Table
Dim que As DataTable
Dim qrow As DataRow
Dim row As Integer
Dim myorderid = CInt(1)
Dim myaccount As DNS.OrdersDB = New DNS.OrdersDB
myserviceid = myaccount.GetServiceType(myorderid)
que = New DataTable
que = DNS.QADB.GetQuestions(myserviceid).Tables(0)
row = CInt(que.Rows.Count)
Dim i As Integer
For i = 0 To row - 1
qrow = que.Rows(i)
Dim mytype As String = qrow("QueType")
Dim myreq As String = qrow("QueRequired")
If mytype = "SHORT TEXT" Or mytype = "LONG TEXT" Then
' Trying to get the value of the textbox
Dim c As TextBox = Page.FindControl(qrow("QueId"))
Dim myresponse As String = c.Text
If myreq = "YES" And myresponse = "" Then
lblerr.Text = qrow("QueName")
lblerr.Visible = True
Else
Dim mysystem As DNS.QADB = New DNS.QADB
Dim mystsring As String = mysystem.addQAResponse(qrow("QueId"), myresponse)
End If
End If
Next
End Sub
It's really very urgent. Please someone help me with this. Any Help is greatly appreciated
Thanks
|
|
|
|
|
ASP.NET questions would be better handled in the ASP.NET Forum. I know you code is written in VB.NET, but it's not a code issue your having. It's more of an ASP.NET technology issue.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
I have a datagrid which i have set up so that if the user clicks on the ListID it redirects to another page and passes the ListID with it.
<asp:hyperlinkcolumn datatextfield="ListID" headertext="Select" datanavigateurlfield="ListID" datanavigateurlformatstring="BBO_StartManual.aspx?ListID={0}">
I have another variable that I want to send to the next page as well which is not from the dataset. Do you know anyway i can send the other vairable? I have tried doing it inline but it just sends the variable as the code i have written.
Am fairly new and so not sure if this is the best way to do it. If this doesn't make sense let me know and i will try to explain.
Cheers,
V
|
|
|
|
|
Sorry forgot to click the check box - here is code which should have been above
<asp:hyperlinkcolumn DataTextField="ListID" HeaderText ="Select" DataNavigateUrlField="ListID" DataNavigateUrlFormatString="BBO_StartManual.aspx?ListID={0}"></asp:hyperlinkcolumn>
Cheers,
V
|
|
|
|
|
Your question would be much better answered in the ASP.NET Forum.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello,
I have win2k SP4 and I need to use some com server from VC++ and VBA6. In C++ I can use sequence like this to get pointer on interface Intrfc1 from ISrvr object:
ISrvr* pSrvr = NULL;
IIntrfc1* pIntrfc1 = NULL;
::CoCreateInstance(CLSID_Srvr,
NULL, CLSCTX_ALL,
IID_ISrvr,
(void **)&pSrvr);
pSrv->QueryInterface(IID_ IIntrfc1, (void**)& pIntrfc1);
What do I need to do in VBA 6.3 to get the same result?
|
|
|
|
|
There are a couple of ways to do it...
The simplest is to use CreateObject() function specifying the ProgID of the component.
The other way is to set a Reference to the object (in Word VBA, go to tools-> References), then declare yourself a variable of that type - this is the early bound version of the late bound Creat object....
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
Hi all,
I draw a rectangle. Now I want, that rectangle changes the color, when mouse over it.
I want to have an event when mouse is over rectangle, and NOT track all mouse moves.
Is it possible? I just can't find a good way to do it?
Thanks a lot,
Boni
|
|
|
|
|
Sure, but you will have to track the mouse movement, if you think about it, if you didn't track the mouse movement it wouldn't be very effective. Assuming your class has a Rectangle object (i.e., rect in the example), within your MouseMove eventhandler you could say:
If rect.Contains(Cursor.Position) Then
'change your color here, you are inside the rectangle
End If
- Nick Parker My Blog | My Articles
|
|
|
|
|
Hi Nick,
thank you so much for the answer. But can't windows notify me with an event, when the mouse is over my rectangle? (I could imagine to register the rectangles "contain"-method somewhere(?)) I fear, that if track mouse for all of my 1000 objects (not only rectangles but even more complicated figures) for each move this will slow down the PC very much.
Thanks for your time,
boni
|
|
|
|
|
I’m about ready to complete my first program, thanks to a lot of you and your help!
I have no idea how to create an installation program though. I want to create an installation program that will:
1-check for certain directories and create them if they are not available
2-install the latest version of the dotnet framework
3-and, of course, install my application.
Can anybody offer any good resources or suggestions?
Thanks
Brad
|
|
|
|
|
To create installation programs, we need to add Setup or Web Setup projects to the solution and manage all the things like directories etc on the target machine.
You will find lot of information on deployment on MSDN
Bhaskara
|
|
|
|