Search Results

Search found 4472 results on 179 pages for 'vb'.

Page 80/179 | < Previous Page | 76 77 78 79 80 81 82 83 84 85 86 87  | Next Page >

  • Keyword 'this'(Me) is not available calling the base constructor

    - by serhio
    In the inherited class I use the base constructor, but can't use class's members calling this base constructor. In this example I have a PicturedLabel that knows it's own color and has a image. A TypedLabel : PictureLabel knows it's type but uses the base color. The (base)image that uses TypedLabel should be colored with the (base)color, however, I can't obtain this color: Error: Keyword 'this' is not available in the current context A workaround? /// base class public class PicturedLabel : Label { PictureBox pb = new PictureBox(); public Color LabelColor; public PicturedLabel() { // initialised here in a specific way LabelColor = Color.Red; } public PicturedLabel(Image img) : base() { pb.Image = img; this.Controls.Add(pb); } } public enum LabelType { A, B } /// derived class public class TypedLabel : PicturedLabel { public TypedLabel(LabelType type) : base(GetImageFromType(type, this.LabelColor)) //Error: Keyword 'this' is not available in the current context { } public static Image GetImageFromType(LabelType type, Color c) { Image result = new Bitmap(10, 10); Rectangle rec = new Rectangle(0, 0, 10, 10); Pen pen = new Pen(c); Graphics g = Graphics.FromImage(result); switch (type) { case LabelType.A: g.DrawRectangle(pen, rec); break; case LabelType.B: g.DrawEllipse(pen, rec); break; } return result; } }

    Read the article

  • Question about WinForms TrackBar control in .Net

    - by Jules
    Does anyone know the millisecond interval, used by the framework trackbar, between calling the ValueChanged event when moving the grip with a mouse? I've implemented my own trackbar and I'd like the behaviour to be consistent with what the user expects. I've had a look in reflector but it's one of those controls where most of the implementation is not viewable. ETA: Actually, thinking about it, it's not as simple as that. For small changes, the TrackBar is raising the event for every change. However, if you make a large fast change with the grip, it will not raise the event for every step. Just wondering exactly how the framework does this? Thanks

    Read the article

  • problem in subreport

    - by prabhudatta sahoo
    suppose i have 2 schema,i.e. fy0910 and fy1011.so when i see the report in schema fy0910 or in fy1011 i have to change every time the schema reference for the subreport,but when i see the report in the specific schema after setting the schema reference then there is no problem in subreport but when i go to another schema then again i have to change the schema reference for sub report.For your kind information there is absolutely no problem in main report.so plz give solution to me i will be thankful to u.

    Read the article

  • Creating Tables in Word Programatically

    - by Ben
    I am generating tables and writing them to word on the fly. I do not know how many tables there will be each time i write the data to word and the problem I am having is the second table is written inside the first cell of my first table. If there was a third table it is put inside the first cell of my second table. Is there a way to move the cursor out of the table? I have tried creating a new range with each table also but the same thing happens. I have also tried things like tbl.Range.InsertParagraphAfter() The closest I came was using the Relocate method, but this only worked for two tables. Thanks Ben

    Read the article

  • how to add Go to Page No. function in xtrareport from runtime ?

    - by ahmed
    Hello, I would like to customize my report. I would like to remove the report toolbar and add manual options to export to just only pdf and excel. Exporting to pdf and excel is working fine with me. The only thing now I need is to paging the reports. I want to add something like " go to page No ..." and the user will click the page no. Is this clear ? Any help will be appreciated. Thanking you all.

    Read the article

  • Unable to get ncName and netBIOSName Properties

    - by Randz
    I've some code on the net regarding retrieval of NetBIOSName (Pre-windows 2000 domain name) of an Active Directory Domain. Here's my code sample: Me._rootDSE = New System.DirectoryServices.DirectoryEntry("GC://RootDSE", "", "") Dim results As System.DirectoryServices.SearchResultCollection = Nothing Dim ADSPath As String = "GC://CN=Partitions," + Me._rootDSE.Properties("configurationNamingContext").Value.ToString() Dim adse As System.DirectoryServices.DirectoryEntry = New System.DirectoryServices.DirectoryEntry(ADSPath, "", "") Dim searcher As System.DirectoryServices.DirectorySearcher searcher = New System.DirectoryServices.DirectorySearcher(adse) searcher.SearchScope = DirectoryServices.SearchScope.OneLevel searcher.Filter = "(&(objectClass=crossRef)(systemflags=3))" searcher.PropertiesToLoad.Add("netbiosname") searcher.PropertiesToLoad.Add("ncname") results = searcher.FindAll() If results.Count > 0 Then For Each sr As System.DirectoryServices.SearchResult In results Dim de As System.DirectoryServices.DirectoryEntry = sr.GetDirectoryEntry() 'netbiosname and ncname properties returns nothing System.Diagnostics.Trace.WriteLine(sr.GetDirectoryEntry().Properties("netbiosname").Value.ToString()) System.Diagnostics.Trace.WriteLine(sr.GetDirectoryEntry().Properties("ncname").Value.ToString()) Next End If When I am using the "(&(objectClass=crossRef)(systemFlags=3))" filter, I am not getting any result, but when I removed the systemFlags filter, I get some results. However, on the search results that I got, I still cannot access the values of ncName and NetBIOSName properties. I can get other properties like distinguishedName and CN of the search result properly. Any idea on what I might be doing wrong, or where to look further?

    Read the article

  • Does binarywriter.flush() also flush the underlying filestream object?

    - by jacob sebastian
    I have got a code snippet as follows: Dim fstream = new filestream(some file here) dim bwriter = new binarywriter(fstream) while not end of file read from source file bwriter.write() bwriter.flush() end while The question I have is the following. When I call bwriter.flush() does it also flush the fstream object? Or should I have to explicitly call fstream.flush() such as given in the following example: while not end of file read from source file bwriter.write() bwriter.flush() fstream.flush() end while A few people suggested that I need to call fstream.flush() explicitly to make sure that the data is written to the disk (or the device). However, my testing shows that the data is written to the disk as soon as I call flush() method on the bwriter object. Can some one confirm this?

    Read the article

  • Regular expressions .net

    - by Tony
    I have the following function that I am using to remove the characters \04 and nulls from my xmlString but I can't find what do I need to change to avoid removing the \ from my ending tags. This is what I get when I run this function <ARR>20080625<ARR><DEP>20110606<DEP><PCIID>626783<PCIID><NOPAX>1<NOPAX><TG><TG><HASPREV>FALSE<HASPREV><HASSUCC>FALSE<HASSUCC> Can anybody help me find out what do I need to change in my expression to keep the ending tag as </tag> Private Function CleanInput(ByVal inputXML As String) As String ' Note - This will perform better if you compile the Regex and use a reference to it. ' That assumes it will still be memory-resident the next time it is invoked. ' Replace invalid characters with empty strings. Return Regex.Replace(inputXML, "[^><\w\.@-]", "") End Function

    Read the article

  • TcpListener.Start() does not open the port

    - by SoMoS
    Hello, I have a class that inherits from the TcpListener, this class Shadows the Start method just to call the base Start() and the base BeginAcceptTcpClient(). From time to time the method is called but the port is not opened (netstat does not show the port open). The class looks like this Public Class ExtendedTcpListener Inherits System.Net.Sockets.TcpListener Public Shadows Sub Start() SyncLock (m_stopLock) MyBase.Start() MyBase.BeginAcceptTcpClient(AddressOf Me.CompleteAcceptTcpClient, Me) My.Application.Log.WriteEntry("Extended Tcp Listener started ...", TraceEventType.Verbose) End SyncLock End Sub Any idea on what's happening or how to debug the issue? As the Start() is called without exception I expected to find the port always opened (the log is always written). Extra information: when the Start method works fine it works each time until app is restarted. When the Start method does not work it won't work again until the app is restarted.

    Read the article

  • ShowDialog won't run

    - by clawson
    I've come across a situation where I try to run a simple line of code in a method Dim res As DialogResult = frmOptions.ShowDialog() but nothing happens. The dialog box will not appear. If I run this method from another location in the code it executes fine (i.e. displays the form in dialog mode and code executes fine thereafter). Hence, it may be the way in which I arrive at this code that is causing my problem, but I cannot see to find what is wrong. When I pause the debugger the line of code is highlighted in green but I can't see to step over it or into it. Any idea what may cause this to happen, or what I should be looking for that might be causing the problem?? Thanks for the help!

    Read the article

  • Visual Studio 2005 - OleDbConnection throws "Invalid authorization specification" in Form Designer,

    - by Jason Dagit
    I have a form with an OleDbConnection object on it. This form fails to load in the Form Designer with the message: One or more errors encountered while loading the designer. The errors are listed below. Some errors can be fixed by rebuilding your project, while others may require code changes. Invalid authorization specification at ADODB.ConnectionClass.Open(String ConnectionString, String UserID, String Password, Int32 Options) ... (stack trace continues into user code) I've tracked this down to the OleDbConnection string. If I hardcode in the server IP, username/password/dbinstance into the constructor of the GUI form then the form will load in the designer. At run-time it is not an issue because we require the user to provide the login details. The question: Is it possible to use the OleDbConnection and the Form designer without supplying the database credentials in the source code of the form? For example, is there a property of the OleDbConnection or Form that I can set so that it doesn't need to access the database during Form design? My concern is that if we ever move the database server or change the login that the code will stop working in the designer.

    Read the article

  • Reflection and changing a variables type at runtime?

    - by james-west
    Hi I'm trying to create an object Of a specific type. I've got the following code, but it fails because it can't cast the new table object to the one that is already defined. I need table to start of an IEnumerable type so I can't declare is an object. Public sub getTable(ByVal t as Type) Dim table As Table(Of Object) Dim tableType As Type = GetType(Table(Of )).MakeGenericType(t) table = FormatterServices.GetUninitializedObject(tableType) End sub So in short - is there a way of changing a variable type at runtime? (or a better way of doing what I'm doing) Thanks in advance. James

    Read the article

  • ASP Web Service Not Working

    - by BlitzPackage
    Good people, Hello. Our webservice is not working. We should be receiving information via an HTTP POST. However, nothing is working. Below are the code files. Let me know what you think. Thanks in advance for any help or information you can provide. (By the way, some information (e.g. class names, connection strings, etc...) has been removed or changed in order to hide any sensitive information. Imports System.Web.Mail Imports System.Data Imports System.Data.SqlClient Imports System.IO Partial Class hbcertification Inherits System.Web.UI.Page Public strBody As String = "" Public sqlInsertStr As String = "" Public errStr As String = "" Public txn_id, first_name, last_name, address_street, address_city, address_state, address_zip, address_country, address_phone, payer_email, Price, key, invoice, payment_date, mc_fee, buyer_ip As String Dim myConn As New SqlConnection(ConfigurationSettings.AppSettings("ConnectionInfo")) '******************************************************************************************* Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load strBody += "Test email sent.Customer name: " & Request("first_name") & " " & Request("last_name") strBody += "Reg Key: " & Request("key") & "Transaction ID: " & Request("txn_id") & "Tran Type: " & Request("txn_type") updateFile(Server.MapPath("log.txt"), strBody) txn_id = Request("txn_id") first_name = Request("first_name") last_name = Request("last_name") address_street = Request("address_street") address_city = Request("address_city") address_state = Request("address_state") address_zip = Request("address_zip") address_country = Request("address_country") address_phone = Request("address_phone") payer_email = Request("payer_email") Price = Request("Price") key = Request("key") invoice = Request("invoice") payment_date = Request("payment_date") mc_fee = Request("mc_fee") buyer_ip = Request("buyer_ip") If Request("first_name") "" And Request("last_name") "" Then SendMail("[email protected]", "[email protected]", strBody, "Software Order Notification", "[email protected]") Else Response.Write("Email not sent. Name missing.") End If Dim sItem As String Response.Write("") If Request.Form("dosubmit") = "1" Then Response.Write("FORM VALS:") For Each sItem In Request.Form Response.Write("" & sItem & " - [" & Request.Form(sItem) & "]") Next sqlInsertStr += "insert into aspnet_MorrisCustomerInfo (TransactionID,FirstName,LastName,AddressStreet,AddressCity,AddressState,AddressZip,AddressCountry,AddressPhone,PayerEmail,Price,AuthenticationCode,InvoiceID,PurchaseDate,PaypalFee,PurchaseIPAddress) values ('" & SQLSafe(txn_id) & "','" & SQLSafe(first_name) & "','" & SQLSafe(last_name) & "','" & SQLSafe(address_street) & "','" & SQLSafe(address_city) & "','" & SQLSafe(address_state) & "','" & SQLSafe(address_zip) & "','" & SQLSafe(address_country) & "','" & SQLSafe(address_phone) & "','" & SQLSafe(payer_email) & "','" & SQLSafe(Price) & "','" & SQLSafe(key) & "','" & SQLSafe(invoice) & "','" & SQLSafe(payment_date) & "','" & SQLSafe(mc_fee) & "','" & SQLSafe(buyer_ip) & "')" runMyQuery(sqlInsertStr, False) End If Response.Write("sqlInsertStr is: " & sqlInsertStr) Response.Write("") End Sub '******************************************************************************************* Sub SendMail(ByVal strEmailAddress, ByVal strEmailAddress_cc, ByVal Email_Body, ByVal Email_Subject, ByVal Email_From) If Request.ServerVariables("server_name") "localhost" Then Try Dim resumeEmail As New MailMessage resumeEmail.To = strEmailAddress resumeEmail.Cc = strEmailAddress_cc resumeEmail.From = Email_From resumeEmail.Subject = Email_Subject resumeEmail.Priority = MailPriority.High 'resumeEmail.BodyFormat = MailFormat.Html resumeEmail.BodyFormat = MailFormat.Html resumeEmail.Body = Email_Body 'System.Web.Mail.SmtpMail.SmtpServer = "morris.com" System.Web.Mail.SmtpMail.SmtpServer = "relay-hosting.secureserver.net" System.Web.Mail.SmtpMail.Send(resumeEmail) Response.Write("Email sent.") Catch exc As Exception Response.Write("MAIL ERROR OCCURRED" & exc.ToString() & "From: " & Email_From) End Try Else Response.Write("TEST RESPONSE" & strBody & "") End If End Sub End Function End Class Process Data Asp.Net Configuration option in Visual Studio. A full list of settings and comments can be found in machine.config.comments usually located in \Windows\Microsoft.Net\Framework\v2.x\Config -- section enables configuration of the security authentication mode used by ASP.NET to identify an incoming user. -- section enables configuration of what to do if/when an unhandled error occurs during the execution of a request. Specifically, it enables developers to configure html error pages to be displayed in place of a error stack trace. --

    Read the article

  • A way to remove selected LineShape shadow effect?

    - by serhio
    Is there a way to remove the LineShape shadow effect when selecting the lineShape? I tried Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs) Dim g As Graphics = e.Graphics g.SmoothingMode = SmoothingMode.AntiAlias Dim oldmode As SmoothingMode = g.SmoothingMode g.DrawLine(_Pen, X1, Y1, X2, Y2) g.SmoothingMode = oldmode End Sub but finally, this have some back effects on invalidation: when moving (in a panel) the line leave traces - does not invalidate properly.

    Read the article

  • Default Object being modified because of LINQ Query

    - by msarchet
    I'm doing the following code to filter a list of objects before it gets sent off to be printed. Dim printList As New List(Of dispillPatient) For Each pat As dispillPatient In patList If (From meds In pat.Medication Select meds Where meds.Print = True).Count > 0 Then Dim patAdd As New dispillPatient patAdd = pat patAdd.Medication = DirectCast((From meds In pat.Medication Select meds Where meds.Print = True).ToList, List(Of dispillMedication)) printList.Add(patAdd) End If Next What is happening is patList, which is my initial list, for every dispillPatient inside of it, that specific patients Medication object (which is another list), is being shorten to the list that is returned to the patAdd object. I think this has something to do with both the way that .NET makes the copy of my pat object when I do patAdd = pat and the LINQ query that I'm using. Has anyone had a similar issue before and\or what can I do to keep my initial list from getting truncated. Thanks

    Read the article

  • Class/Model Level Validation (as opposed to Property Level)? (ASP.NET MVC 2.0)

    - by Erx_VB.NExT.Coder
    Basically, what the title says. I have several properties that combine together to really make one logical answer, and i would like to run a server-side validation code (that i write) which take these multiple fields into account and hook up to only one validation output/error message that users see on the webpage. I looked at scott guthries method of extending an attribute and using it in yoru dataannotations declarations, but, as i can see, there is no way to declare a dataannotations-style attribute on multiple properties, and you can only place the declarations (such as [Email], [Range], [Required]) over one property :(. i have looked at the PropertiesMustMatchAttribute in the default mvc 2.0 project that appears when you start a new project, this example is as useful as using a pair of pins to check your motor oil - useless! i have tried this method, however, creating a class level attribute, and have no idea how to display the error from this in my aspx page. i have tried html.ValidationMessage("ClassNameWhereAttributeIsAdded") and a variety of other thing, and it has not worked. and i should mention, there is NOT ONE blog post on doing validation at this level - despite this being a common need in any project or business logic scenario! can anyone help me in having my message displayed in my aspx page, and also if possible a proper document or reference explaining validation at this level?

    Read the article

  • Regex For Finding Ctypes with Int32

    - by Stefan H
    (Hey all, I am looking for a little regex help... I am trying to find all CType(expression,Int32) s and replace them with CInt(expression) This, however, is proving quite difficult, considering there could be a nested Ctype(expression, Int32) within the regex match. Does anyone have any ideas for how to best go about doing this? Here is what I have now: Dim str As String = "CType((original.Width * CType((targetSize / CType(original.Height, Single)), Single)), Int32)" Dim exp As New Regex("CType\((.+), Int32\)") str = exp.Replace(str, "CInt($1)") But this will match the entire string and replace it. I was thinking of doing a recursive function to find the outer most match, and then work inwards, but that still presents a problem with things like CType(replaceChars(I), Int32)), Chr(CType(replacementChars(I), Int32) Any tips would be appreciated. Input returnString.Replace(Chr(CType(replaceChars(I), Int32)), Chr(CType(replacementChars(I), Int32))) Output: returnString.Replace(Chr(CInt(replaceChars(I))),Chr(CInt(replacementChars(I)))) Edit: Been working on it a little more and have a recursive function that I'm still working out the kinks in. Recursion + regex. it kinda hurts. Private Function FindReplaceCInts(ByVal strAs As String) As String System.Console.WriteLine(String.Format("Testing : {0}", strAs)) Dim exp As New Regex("CType\((.+), Int32\)") If exp.Match(strAs).Success Then For Each match As Match In exp.Matches(strAs) If exp.Match(match.Value.Substring(2)).Success Then Dim replaceT As String = match.Value.Substring(2) Dim Witht As String = FindReplaceCInts(match.Value.Substring(2)) System.Console.WriteLine(strAs.IndexOf(replaceT)) strAs.Replace(replaceT, Witht) End If Next strAs = exp.Replace(strAs, "CInt($1)") End If Return strAs End Function Cheers,

    Read the article

  • Aspect oriented Programming?

    - by Jaswant Agarwal
    How can we apply attributes to class fucntion using AOP in C#? UPDATE: I am slightly not clear in what context AOP should be used? As we can use AOP for logging purpose, security(Authentication), please suggest some other scenarios where we can take benefit of AOP Is AOP can be use to share data among different running threads in application process?

    Read the article

  • Nunit test project won't compile under mono

    - by Quandary
    Question: I am implementing an OpenSource version of Microbosoft Sync framework, [http://www.microsoft.com/downloads/d...isplaylang=en] (Checkout: git clone [email protected]:quandary/SyncFramework.git) but I ran into a unittest problem. I added a nunit test-project to the C# project, but it's not compiling... I created the project on Windows, and there it compiled well. On Linux, the project compiles well, but compiling the unittest, I always get: Assembly 'nunit.framework, Version=2.5.5.10112, Culture=neutral, PublicKeyToken=96d09 My problem now is I installed nunit and added a reference to it (on Linux with mono), but I still get this message, I take out 'require specific version', and I still get this message... I also removed the windows reference to nunit, but still no change.

    Read the article

  • AutoCompleteExtender not suggesting search terms

    - by Phil
    My codebehind method: <System.Web.Services.WebMethodAttribute(), System.Web.Script.Services.ScriptMethodAttribute()> _ Public Shared Function GetCompletionList(ByVal prefixText As String, ByVal count As Integer, ByVal contextKey As String) As String() ' Create array of movies Dim movies() As String = {"Star Wars", "Star Trek", "Superman", "Memento", "Shrek", "Shrek II"} ' Return matching movies Return From m In movies Where (m.StartsWith(prefixText, StringComparison.CurrentCultureIgnoreCase)) Select m _ .Take(count).ToArray() End Function End Class Then in my aspx page I have: <form id="form1" runat="server"> <div> <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"> </asp:ToolkitScriptManager> <br /> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> <asp:AutoCompleteExtender ID="TextBox1_AutoCompleteExtender" runat="server" DelimiterCharacters="" Enabled="True" ServiceMethod="GetCompletionList" ServicePath="" TargetControlID="TextBox1" UseContextKey="True" MinimumPrefixLength="2"> </asp:AutoCompleteExtender> </div> </form> When I run the page there are no errors, but there also are no auto complete suggestions. Please help!

    Read the article

< Previous Page | 76 77 78 79 80 81 82 83 84 85 86 87  | Next Page >