Search Results

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

Page 27/179 | < Previous Page | 23 24 25 26 27 28 29 30 31 32 33 34  | Next Page >

  • Grouping a generic list via LINQ in VB.NET

    - by CD Smith
    I need to take a collection and group it via Linq but all the examples I've seen fail in some manner or other with some syntax difference that I can't quite lick. My collection: Dim a As New List(Of ProcessAlert) a.Add(New ProcessAlert("0000112367", "[email protected]", "Alert", 2)) a.Add(New ProcessAlert("0000112367", "[email protected]", "Document", 2)) a.Add(New ProcessAlert("0000112367", "[email protected]", "Note", 2)) a.Add(New ProcessAlert("0000112367", "[email protected]", "Alert", 1)) a.Add(New ProcessAlert("0000112367", "[email protected]", "Document", 1)) a.Add(New ProcessAlert("0000112367", "[email protected]", "Note", 1)) Return a I need to turn this collection into a simple way to give this final outcome: "[email protected]", "Alert, Document, Note" "[email protected]", "Alert, Document, Note" Here's the definition of the ProcessAlert class: Public Class ProcessAlert Public LoanNumber As String Public EmailAddress As String Public AlertType As String Public AlertMethodID As Byte End Class Thanks in advance, CD

    Read the article

  • VB.NET: Scrollbar "button"?

    - by Omega
    I plan on using a scrollbar for, well, scrolling an image. The image is 200x500, however, the only visible area is 200x250. So I set the max value to 250, and the min value to 0. The idea is that if I drag the scrollbar's button to the bottom, 250 pixels will have moved for the image, right? But wait, the scrollbar's button is.... very small. And the scrollbar is actually pretty long. Is there a way to make the scrollbar's button longer?

    Read the article

  • VB.Net 2008 Chrome or Firefox control

    - by AndyD273
    I'm trying to figure out a way to have multiple sessions at the same website at the same time. I've been using the SHDocVw.InternetExplorer control in Visual Studio 2008 to open a web browser and log in, but at times we need to use a separate login. I haven't found a way to do this using just internet explorer (it just uses the credentials of the first login), so I figure if I can find a similar control for another brower that allows DOM level access then I can just use that. If anyone knows of anything I can try that would be very helpful.

    Read the article

  • vb.net -- Using arraylist as key in dictionary

    - by Zahid
    Dim dct As New Dictionary(Of ArrayList, ArrayList) ' Populate Dictionary dct.Add(New ArrayList({"Dot", "0"}), New ArrayList({20, 30, 40, 50})) dct.Add(New ArrayList({"Dot", "1"}), New ArrayList({120, 130, 140, 150})) ' Search in dictionary Dim al As New ArrayList({"Dot", "2"}) If dct.ContainsKey(al) Then *' does not work* MessageBox.Show("Found: " & al(0).ToString) End If

    Read the article

  • opening transaction validation in vb.net

    - by Mark
    Can anyone help me on how can I validate transaction example: transaction = mySqlConn.BeginTransaction(IsolationLevel.ReadCommitted) If there's still an opened transaction, then the code above will ignore.. How do I know if there was a transaction not yet committed before opening new transaction to avoid Nested Transaction?

    Read the article

  • trim last "," delimiter of a string in vb.net

    - by gerfe
    this is my code - With ad.Tables(2) For i As Integer = 0 To .Rows.Count - 1 If .Rows(i)("name") & "" <> "" Then temp &= .Rows(i)("name") & ", " End If Next End With temp = temp.Trim(",") testing &= "&Name=" & temp & vbCrLf with this is get a comma in the end of the string. but if i do this temp = temp.Trim.Trim(",") all commas are deleted. How do i keep all commas and only delete the last one?

    Read the article

  • how to change windowXP theme using vb.net2005

    - by Darshna Raghani
    I have tried the following code but has no effect: Imports system.Runtime.InteropServices <DllImport("UxTheme.DLL", BestFitMapping:=False, CallingConvention:=CallingConvention.Winapi, CharSet:=CharSet.Unicode, EntryPoint:="#65")> _ Shared Function SetSystemVisualStyle(ByVal pszFilename As String, ByVal pszColor As String, ByVal pszSize As String, ByVal dwReserved As Integer) As Integer End Function Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 'This code will set Window Themes SetSystemVisualStyle("C:\WINDOWS\Resources\Themes\HmmXP_2_0_1\HmmXP\HmmXP.msstyles", "NormalColor", "NormalSize", 0) End Sub Can anyone plz help?

    Read the article

  • redirect an event in VB.NET

    - by serhio
    I havea a UserControl1 (in witch I have an Label1) in Form1. I want to catch the MouseDown event from label and send it like from UserControl I do: Public Class UserControl1 Shadows Custom Event MouseDown As MouseEventHandler AddHandler(ByVal value As MouseEventHandler) AddHandler Label1.MouseDown, value End AddHandler RemoveHandler(ByVal value As MouseEventHandler) RemoveHandler Label1.MouseDown, value End RemoveHandler RaiseEvent(ByVal sender As Object, ByVal e As MouseEventArgs) 'RaiseMouseEvent(Me, e) ??? ' End RaiseEvent End Event End Class However, when I set in the Form1 the UserControl Private Sub UserControl11_MouseDown(ByVal sender As System.Object, _ ByVal e As System.Windows.Forms.MouseEventArgs) _ Handles UserControl11.MouseDown MessageBox.Show(sender.GetType.Name) 'here I have 'Label', want 'UserControl' End Sub

    Read the article

  • VB working with SQL DB - end of row count, keeps looping

    - by Tramd
    I'm adding to a combo box an ID and a name that i'm pulling from a database. My problem is that for some reason my loop doesnt end once it reaches the end of the records in the database table. Here's my code: For intcount = 0 To dtOrders.Rows.Count - 1 cmbSearch.Items.Add(dtOrders.Rows(intcount)("EmployeeID").ToString & " " & dtOrders.Rows(intcount)("EmployeeLastName").ToString & ", " & dtOrders.Rows(intcount)("EmployeeFirstName").ToString) Next Shouldnt the .rows.count - 1 stop it once it reaches the last record? It loops 4 times through.

    Read the article

  • ListView ToolTip only in First Cell - VB.NET

    - by Louise
    I'm adding a ToolTip to a ListViewItem. However, the ToolTip only shows up when the user hovers over the first cell in the row to which the ToolTip has been applied. MyListViewItem.ToolTipText = "Important Message" The only other code I have related to ToolTips is this: MyListView.ShowItemToolTips = True Any idea how I can make the ToolTip show up on a specific cell in a row, or even the entire row? Thanks.

    Read the article

  • error in mysql syntax in vb.net

    - by user225269
    I get this error, while I'm testing the code below: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[student](ID, LASTNAME, FIRSTNAME, SCHOOL) VALUES ('333', 'aaa', 'aaa', 'aaa')' at line 1 I just recycled the code that I used in manipulating ms sql database. So the syntax must be wrong. What might be the correct syntax for adding records into mysql database? Here is my current code: idnum = TextBox1.Text lname = TextBox2.Text fname = TextBox3.Text skul = TextBox4.Text Using sqlcon As New MySqlConnection("Server=localhost; Database=testing;Uid=root;Pwd=nitoryolai123$%^;") sqlcon.Open() Dim sqlcom As New MySqlCommand() sqlcom.Connection = sqlcon sqlcom.CommandText = "INSERT INTO [student](ID, LASTNAME, FIRSTNAME, SCHOOL) VALUES (@ParameterID, @ParameterLastName, @ParameterFirstName, @ParameterSchool)" sqlcom.Parameters.AddWithValue("@ParameterID", TextBox1.Text) sqlcom.Parameters.AddWithValue("@ParameterLastName", TextBox2.Text) sqlcom.Parameters.AddWithValue("@ParameterFirstName", TextBox3.Text) sqlcom.Parameters.AddWithValue("@ParameterSchool", TextBox4.Text) sqlcom.ExecuteNonQuery() End Using Please help, thanks

    Read the article

  • how to make the printer window appear using vb.net 2010

    - by Jeline Esase
    hi I have this code that will send my panel into a printer but the problem is it doesent let me choose which printer I will use any idea on how can I make the printer window appear? thanks Public Class Form1 Dim img As Bitmap Dim WithEvents pd As PrintDocument 'Returns the Form as a bitmap Function CaptureForm1() As Bitmap Dim g1 As Graphics = Me.CreateGraphics() Dim MyImage = New Bitmap(Me.ClientRectangle.Width, (Me.ClientRectangle.Height), g1) Dim g2 As Graphics = Graphics.FromImage(MyImage) Dim dc1 As IntPtr = g1.GetHdc() Dim dc2 As IntPtr = g2.GetHdc() BitBlt(dc2, 0, 0, Me.ClientRectangle.Width, (Me.ClientRectangle.Height), dc1, 0, 0, 13369376) g1.ReleaseHdc(dc1) g2.ReleaseHdc(dc2) 'saves image to c drive just, u can comment it also 'MyImage.Save("c:\abc.bmp") Return MyImage End Function <DllImport("gdi32.DLL", EntryPoint:="BitBlt", _ SetLastError:=True, CharSet:=CharSet.Unicode, _ ExactSpelling:=True, _ CallingConvention:=CallingConvention.StdCall)> _ Private Shared Function BitBlt(ByVal hdcDest As IntPtr, ByVal nXDest As Integer, ByVal nYDest As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal hdcSrc As IntPtr, ByVal nXSrc As Integer, ByVal nYSrc As Integer, ByVal dwRop As System.Int32) As Boolean ' Leave function empty - DLLImport attribute forwards calls to MoveFile to ' MoveFileW in KERNEL32.DLL. End Function Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click img = CaptureForm1() pd = New PrintDocument pd.Print() End Sub 'this method will be called each time when pd.printpage event occurs Sub pd_PrintPage(ByVal sender As Object, ByVal e As PrintPageEventArgs) Handles pd.PrintPage Dim x As Integer = e.MarginBounds.X Dim y As Integer = e.MarginBounds.Y e.Graphics.DrawImage(img, x, y) e.HasMorePages = False End Sub End Class

    Read the article

  • VB.NET Winform & UltraTree ?

    - by bochur1
    Can someone tell me how I can binding an Ultratree to a Bindingsource? Binding it to a dataset won't work for me since I need to be able to do filters on the data, something I have in the BindingSource but not in the Dataset.

    Read the article

  • Undetermined type conversion in VB.NET 2008

    - by user337501
    I figured this would be a quick google, but extensive searching hasnt yielded any results. Everything about type conversion seems to dance around this concept. I want to get the type of variable "a", and make a new variable named "b" of that type. Otherwise I could have "a" as a type already declared and "b" simply as an Object, then try to cast "b" to the type of "a". Dim a As Integer Dim b As Whatever a Is OR TryCast(b, Whatever a Is) I would also like to make the conversion using a variable representation of the type, but cant find info on how to do that either. Sorta like: Dim a As Integer Dim b As Object Dim t As Type t = a.GetType() TryCast(b, t) Realizing I'm completely misusing TryCast here, I'm mostly trying to get my goal across. I figured it would be an easy quick thing to do but I cant really find any specific info on it. Any ideas?

    Read the article

  • adding swf alpha transparency in vb.net

    - by testkhan
    i have a windows form with shockwave flash object in it in shockwaveflashobject i have a swf animated logo with green background now i want to add transparency key for that green background. but the transparency key for that is not working how can i get rid of that green background. actually i am using that logo as a overlay on windowsmedia player..

    Read the article

  • get length of data sent over network to TCPlistener/networkstream vb.net

    - by Jonathan.
    It seems the most obvious thing, but I just can't work out how to get the length of bytes sent over a network using a TCPClient and TCPListener? This is my code so far: 'Must listen on correct port- must be same as port client wants to connect on. Const portNumber As Integer = 9999 Dim tcpListener As New TcpListener(IPAddress.Parse("192.168.2.7"), portNumber) tcpListener.Start() Console.WriteLine("Waiting for connection...") 'Accept the pending client connection and return 'a TcpClient 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 I need to get the length of the networkstream to set the size of the array of bytes I'm going to read the data into. But the networkStream.length is unsupported and does not work and throws an Notsupportedexception. The only other way I can think of is to send the size of the data before sending the data, but this seems the long way round.

    Read the article

  • LINQ VB.NET variable not found when looping through grouped query

    - by Ed Sneller
    I'm trying to do the following LINQ grouping, which works in the debugger (the results are populated in the GroupedOrders object. But VS 2008 gives me the following error at design time... Name 'x' is not declared Dim GroupedOrders = (From m In thisConsultant.orders _ Group m By Key = m.commCode Into Group _ Select commCode = Key, orders = Group) For Each x In GroupedOrders Next VS 2008 gives me the following error,

    Read the article

  • listview tile layout problem (vb.net)

    - by Matt Facer
    hi guys, I have a listview which displays (eventually) an album cover of an itunes play list with the album name under it. the problem I am having is that I cannot get the album art (currently a blank square) ABOVE the album name. It always is on the side... how do I do it? I've tried adding column headers and alsorts... code to set up the listview Dim myImageList As ImageList albumList.View = View.Tile albumList.TileSize = New Size(120, 150) ' Initialize the item icons. myImageList = New ImageList() myImageList.Images.Add(Image.FromFile("c:/test.jpg")) myImageList.ImageSize = New Size(80, 80) albumList.LargeImageList = myImageList I then do a loop to display each album name which uses Dim item0 As New ListViewItem(New String() _ {Albums(i).Name}, 0) albumList.Items.Add(item0) the output is http://i111.photobucket.com/albums/n122/mfacer/Screenshot2010-05-02at164815.png but as i said, I want the album name under the orange box.... any ideas?? Thanks for any info!

    Read the article

  • VB.net: Custom ' TODO: List on an Interface

    - by Shiftbit
    How do I add my own todo and comments list to appear on Interfaces? I want it to pop up like IDisposable does: Public Class Foo : Implements IDisposable Private disposedValue As Boolean = False ' To detect redundant calls ' IDisposable Protected Overridable Sub Dispose(ByVal disposing As Boolean) If Not Me.disposedValue Then If disposing Then ' TODO: free other state (managed objects). End If ' TODO: free your own state (unmanaged objects). ' TODO: set large fields to null. End If Me.disposedValue = True End Sub #Region " IDisposable Support " ' This code added by Visual Basic to correctly implement the disposable pattern. Public Sub Dispose() Implements IDisposable.Dispose ' Do not change this code. Put cleanup code in Dispose(ByVal disposing As Boolean) above. Dispose(True) GC.SuppressFinalize(Me) End Sub #End Region End Class Whenever I enter my own comments and todo list they are never autogenerated like IDisposable Interface does. I would like my own Interfaces to preserve the comments so that I can share my Interfaces with in source documentation.

    Read the article

  • VB.NET - Convert Unicode in one TB to Shift-JIS in another TB

    - by Yiu Korochko
    Trying to develop a text editor, I've got two textboxes, and a button below each one. When the button below textbox1 is pressed, it is supposed to convert the Unicode text (intended to be Japanese) to Shift-JIS. The reason why I am doing this is because the software VOCALOID2 only allows ANSI and Shift-JIS encoding text to be pasted into the lyrics system. Users of the application normally have their keyboard set to change to Japanese already, but it types in Unicode. How can I convert Unicode text to Shift-JIS when SJIS isn't available in the System.Text.Encoding types?

    Read the article

  • VB.Net List.Find. Pass values to predicate

    - by Beta033
    Having a bit of trouble using the List.Find with a custom predicate i have a function that does this private function test () Dim test As Integer = keys.Find(AddressOf FindByOldKeyAndName).NewKey here's the function for the predicate Private Shared Function FindByOldKeyAndName(ByVal k As KeyObj) As Boolean If k.OldKey = currentKey.OldKey And k.KeyName = currentKey.KeyName Then Return True Else Return False End If End Function by doing it this way means i have to have a shared "currentKey" object in the class, and i know there has to be a way to pass in the values i'm interested in of CurrentKey (namely, keyname, and oldkey) ideally i'd like to call it by something like keys.Find(AddressOf FindByOldKeyAndName(Name,OldVal)) however when i do this i get compiler errors. How do i call this method and pass in the values?

    Read the article

  • Upsert - Efficient Update or Insert in VB.Net, SQL Server

    - by HK1
    I'm trying to understand how to streamline the process of inserting a record if none exists or updating a record if it already exists. I'm not using stored procedures, although maybe that would be the most efficient way of doing this. The actual scenario in which this is necessary is saving a user preference/setting to my SettingsUser table. In MS Access I would typically pull a DAO recordset looking for the specified setting. If the recordset comes back empty then I know I need to add a new record which I can do with the same recordset object. On the other hand, if it isn't empty, I can just update the setting's value right away. In theory, this is only two database operations. What is the recommended way of doing this in .NET?

    Read the article

  • Global hotkey capture in VB.net

    - by ggonsalv
    I want to have my app which is minimized to capture data selected in another app's window when the hot key is pressed. My app definitely doesn't have the focus. Additionally when the hot key is pressed I want to present a fading popup (Outlook style) so my app never gets focus. At a minimum I want to capture the Window name, Process ID and the selected data. The app which has focus is not my application? I know one option is to sniff the Clipboard, but are there any other solutions. This is to audit the rate of data-entry in to another system of which I have no control. It is a mainframe emulation client program(attachmate). The plan is complete data entry in Application X. Select a certain section of the screen in App X which is proof of data entry (transaction ID). Press the Magic Hotkey, which then 'sends' the selection to my App. From System.environment or system.Threading I can find the Windows logon. Similiarly I can also capture the time. All the data will be logged to SQL. Once Complete show Outlook style pop up saying the data entry has been logged. Any thoughts.

    Read the article

< Previous Page | 23 24 25 26 27 28 29 30 31 32 33 34  | Next Page >