|
It's a typo. What he means is:
No instance of the class is created on the heap because an object instance is not required to invoke a static method.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
I have an MDI project with, so far, 5 MDI child forms. One menu item on the main form, mnuWindows, is set as the MdiWindowListItem on the MenuStrip. Here's the puzzling behaviour.
Whenever one particular MDI child form, F_Import, is open, the form changes how the MdiWindowListItem drop down menu works. It doesn't matter which of the other 4 child forms are open or may be the active child, when I click on the MdiWindowListItem menu, F_Import immediately receives the focus and is checked on the drop down menu. Selecting another child from the menu gives that child the focus, but, opening the MdiWindowListItem drop down menu immediately places the focus back on F_Import.
When F_Import is not open, the MdiWindowListItem drop down menu acts as expected. When the drop down menu is opened, the child form currently having the focus is also the form checked on the menu.
I have not been able to identify any form or menustrip property that affects this errant behaviour. Nor has a search on the Internet revealed any related information. Anyone run into this issue before?
|
|
|
|
|
The errant behaviour stopped when I removed the word "Import" from the form Name property.
|
|
|
|
|
chalk it up to just being the nature of VB
"I need build Skynet. Plz send code"
|
|
|
|
|
Hi,
I have writen my own front-end for a carPC project and for a final touch I thought I would have an option to wirelessly update the MP3 shared folder on my PC when I am in the driveway.
Right, what I have done is set my home PC to a static IP address of '192.168.0.136' and a shared folder called 'mp3'
Here is a small bit of code demonstating what I want to do...
strHubComputerIP = "192.168.0.136"
strHubComputerMp3Folder = "mp3"
strRemoteDirectory = New DirectoryInfo("\\" & strHubComputerIP & "\" & strHubComputerMp3Folder & "\")
If strRemoteDirectory.Exists Then............
this works fine, but if I change the IP address to "192.168.0.135" or the 'hub' computer is off (the IP address can't be seen), the computer hangs for 2 minutes.
For example, if I pull into my drive and want to update, but my home PC is off, I don't want the computer in the car to hang. I want it to tell me that the IP address isn't found.
Hope someone can help, I've been working on my front-end for a year now as I've been saving up for the hardware. This is the last bit I need to sort out, then I can build the machine
|
|
|
|
|
Just incase anyone was going to answer this question, I have found a way of doing it.
Instead of using IP address, I use 'computer name'
strHubComputerName = "main-computer"
strHubComputerMp3Folder = "mp3"
strRemoteDirectory = New DirectoryInfo("\\" & strHubComputerName & "\" & strHubComputerMp3Folder & "\")
If strRemoteDirectory.Exists Then............
This only hangs for 2 seconds if the 'folder' isn't found. This is far better.
|
|
|
|
|
Plz am trying to use SMTP to send an email
the error is receive is "Operation Time-Out"
Thank sin advance
phatkin
|
|
|
|
|
Try posting some code, your post is rather vague.
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
Imports System.Net.Mail
Dim strTo As String = "abc@abc.com"
Dim strFrom As String = "abc@abc.com"
Dim strSubject As String = "First Email"
Dim strBody As String = "Testing"
Dim objMailMessage As New MailMessage(strFrom, strTo, strSubject, strBody)
Dim objSMTPClient As New SmtpClient()
objSMTPClient.UseDefaultCredentials = True
objSMTPClient.Host = "000.00.0.00"
objSMTPClient.Port = 25
objSMTPClient.Send(objMailMessage)
|
|
|
|
|
Nice code, but it does not necessarily answer the OP's question as to why they are getting a time out...
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
Odds are you have a network connection or server configuration issue. Hard to say, even if I saw the code, just because the server doesn't work for me, doesn't mean it shouldn't work for you.
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 )
|
|
|
|
|
I am using datagridview in my form and it is bound to a datatable.I have a add button on the form which added a new row in the datatable.Now what I want is that when user click on the add button it should the cursor should go to the new added row.
For example if there are more than 20 items in the grid view and user click add button then it will be added at the last but it does not scroll to the last row.
How can I solve this problem?
Thanks in advance
|
|
|
|
|
Isn't there a SetFocus method you can apply on the currently selected row? If so, you get the index of the newly added row and do a SetFocus on it.
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
Thanks for reply.It does get the focus on the last row but if the last row is now visible in the gridview then the gridview should scroll to the focused row.
|
|
|
|
|
I am using Replace function to replace the occurance of a double Quote (") in a string. But it shows me error. Can anyone suggest how to achieve that. The code i am using is as given :
DocStr = Replace(DocStr, """, "``", 0, , )
Here I want to replace the " with ``.
Please Help. Thanks in advance.
Sekhar
|
|
|
|
|
As oppose to using """ try using the character code(34). As """ causes a problem (i presume) as " is part of the syntax syntax.
e.g.
docstr = replace(docstr,chrw(34),"``",0,,)
modified on Saturday, January 19, 2008 7:40:16 AM
|
|
|
|
|
You use double quotation marks to put a quotation mark in a string:
DocStr = Replace(DocStr, """", "``", 0, , )
But why are you replacing the quotation marks with something that looks similar to a quotation mark? I seems like you are trying to circumvent some characters because you don't know how to handle them correctly.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
Yes I want to replace the double quotes from a string that I have retrieved. How can i replace the double quotes from a string using the replace() function.
Please Help.
Sekhar
|
|
|
|
|
Eh...? You didn't read my previous post, you just replied to it anyway?
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
hello there,
i have 2 nested datalist, and i cant call the inner one.
i just want to access its' controls (textbox, ets) from the code behind.
Here is the aspx page and followed by the aspx.vb page:
<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="testing.aspx.vb" Inherits="testing" title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script language="javascript" type="text/javascript">
// <!CDATA[
// ]]>
</script>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:bschutzConnectionString %>"
SelectCommand="SELECT [fold_id], [folder_name], [commid] FROM [folders]"></asp:SqlDataSource>
<asp:DataList ID="DataList1" runat="server" BackColor="#DEBA84" BorderColor="#DEBA84"
BorderStyle="None" BorderWidth="1px" CellPadding="3" CellSpacing="2" DataSourceID="SqlDataSource1"
GridLines="Both" Width="527px">
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<SelectedItemStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<ItemTemplate>
<table id="TABLE1" onclick="return TABLE1_onclick()">
<tr>
<td style="width: 100px; height: 21px;">
folder Id:&nbsp;</td>
<td style="width: 291px; height: 21px;">
<asp:Label ID="fold_idLabel" runat="server" Text='<%# Eval("fold_id") %>'></asp:Label></td>
<td style="width: 410px; height: 21px;">
</td>
</tr>
<tr>
<td style="width: 100px; text-align: left;">
folder Name:</td>
<td style="width: 291px">
<asp:LinkButton ID="LinkButton1" runat="server" Text='<%# Eval("folder_name", "{0}") %>' OnClick="LinkButton1_Click"></asp:LinkButton></td>
<td style="width: 410px; text-align: right;">
<asp:LinkButton ID="LinkButton2" Text="Edit" CommandName= "Edit" runat="server"></asp:LinkButton></td>
</tr>
<tr>
<td style="width: 100px">
</td>
<td style="width: 291px">
</td>
<td style="width: 410px">
</td>
</tr>
</table>
<br />
<asp:DataList ID="DataList2" runat="server" BackColor="LightGoldenrodYellow" BorderColor="Tan"
BorderWidth="1px" CellPadding="2" DataKeyField="id" DataSourceID="SqlDataSource1"
ForeColor="Black" Width="821px">
<FooterStyle BackColor="Tan" />
<SelectedItemStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" />
<ItemTemplate>
&nbsp;<br />
<table>
<tr>
<td style="width: 100px">
foled id:</td>
<td style="width: 100px">
<asp:Label ID="folidLabel" runat="server" Text='<%# Eval("folid") %>'></asp:Label></td>
<td style="width: 100px">
</td>
</tr>
<tr>
<td style="width: 100px">
File Id:&nbsp;
</td>
<td style="width: 100px">
<asp:Label ID="idLabel" runat="server" Text='<%# Eval("id") %>'></asp:Label></td>
<td style="width: 100px">
</td>
</tr>
<tr>
<td style="width: 100px">
File Subject:
</td>
<td style="width: 100px">
<asp:Label ID="subjectLabel" runat="server" Text='<%# Eval("subject") %>'></asp:Label></td>
<td style="width: 100px">
</td>
</tr>
</table>
<br />
<br />
<br />
</ItemTemplate>
<AlternatingItemStyle BackColor="PaleGoldenrod" />
<HeaderStyle BackColor="Tan" Font-Bold="True" />
</asp:DataList><asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:bschutzConnectionString %>"
SelectCommand="SELECT [folid], [id], [subject] FROM [minutes] WHERE ([folid] = @folid)">
<SelectParameters>
<asp:ControlParameter ControlID="HiddenField1" Name="folid" PropertyName="Value"
Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
<asp:HiddenField ID="HiddenField1" runat="server" Value='<%# Eval("fold_id", "{0}") %>' />
<br />
</ItemTemplate>
<ItemStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
<EditItemTemplate>
<table>
<tr>
<td style="width: 100px; height: 21px">
Folder Name</td>
<td style="width: 100px; height: 21px">
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Eval("folder_name", "{0}") %>'></asp:TextBox></td>
<td style="width: 100px; height: 21px">
<asp:LinkButton ID="LinkButton3" Text="cancel" CommandName="Cancel" runat="server"></asp:LinkButton></td>
</tr>
<tr>
<td style="width: 100px">
</td>
<td style="width: 100px">
</td>
<td style="width: 100px">
</td>
</tr>
</table>
</EditItemTemplate>
</asp:DataList>&nbsp;
</asp:Content>
this is the ASPX.VB
Partial Class testing
Inherits System.Web.UI.Page
Protected Sub DataList1_EditCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataListCommandEventArgs) Handles DataList1.EditCommand
DataList1.SelectedIndex = e.Item.ItemIndex
DataList1.EditItemIndex = e.Item.ItemIndex
DataList1.DataBind()
End Sub
Protected Sub DataList1_CancelCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataListCommandEventArgs) Handles DataList1.CancelCommand
DataList1.SelectedIndex = -1
DataList1.EditItemIndex = -1
DataList1.DataBind()
End Sub
Protected Sub LinkButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim dtl2 As DataListItem = (DataList1.FindControl("Datalist2"))
dtl2.Visible = False
End Sub
End Class
the ERROR page
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 18: Protected Sub LinkButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Line 19: Dim dtl2 As DataListItem = (DataList1.FindControl("Datalist2"))
Line 20: dtl2.Visible = False
Line 21: End Sub
Line 22: End Class
Thanks in advance
Edward Topalian
|
|
|
|
|
Hello there i got the Answer to this question.\
it is:
Dim but As LinkButton = sender ' linkbutton that i'm calling from.
Dim sl1 As DataListItem = but.NamingContainer
sl1.FindControl("DataList2").Visible = False
'Datalist2 is the child datalist.
'so this way i can call anyitem in the chinld datalist
|
|
|
|
|
Hi all,
I'm Beginner in VB .Net,now i'm havng 10 Forms in my project
named as form1,form2,form3 etc,.
How to change the name of that form,and wat r the changes, we need to do ,if we change the name of a form,,
Any one plz help me in this regard,,,,
Thanks in advance
Saravana...
|
|
|
|
|
In the solution explorer click on the form and then click it again (like windows explorer) so that you can rename it. When You rename the file it should automatically rename the form class itself. Compile after each rename to ensure that the application still compiles. If the application doesn't compile then the form renaming process won't work properly.
|
|
|
|
|
Hi Friend,
Colin is right, another thing is to buy a Book in Introduction to Vb.net, i thik you are starting Programming in VB.NT you dont have never developed in vb6, but buy a book and google for vb.net free e-books. it will help you.
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Please help!!
How can i preview single/multipage images on a form?
|
|
|
|