Jump to content
Xtreme .Net Talk

davidrobin

Avatar/Signature
  • Posts

    41
  • Joined

  • Last visited

About davidrobin

  • Birthday 09/10/1971

Personal Information

  • Visual Studio .NET Version
    Visual Basic .NET 2003 Enterprise Architect
  • .NET Preferred Language
    VB.NET

davidrobin's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. RE: PageSetupDialog bug with margins
  2. Is there anyone who has managed this yet as i still need to do this.
  3. I have a dynamically created HTMLInputText HTMLControl. I have some javascript I want to call <script language="javascript"> <!-- function gohere(){ if (document.getElementById('Text1').value == 'L') {document.getElementById('Select1').style.display = 'none'} else {document.getElementById('Select1').style.display = ''} } //--> </script> The code for creating the HTMLInputText control is this tbcCell = New TableCell Dim txtMarkBox As New HtmlInputText txtMarkBox.ID = "HTMLMark" & i.ToString txtMarkBox.EnableViewState = True txtMarkBox.MaxLength = 1 tbcCell.Controls.Add(txtMarkBox) tbrRow.Cells.Add(tbcCell) How do I tell the HTMLInputText control to call the javascrtipt on the onblur event?
  4. I am dynamically creating textboxes and for each textbox a custom validator control. How do I link the validator control to the textbox so it can be Validated. Thanks
  5. That stops the errors so the app will compile but no text is displayed on the screen.
  6. I am working my way through Jack Hoxleys DirectX9 (http://www.directx4VB.com) example. When I try and compile the application I get this error: Overload resolution failed because no accessible 'DrawText' accepts this number of arguments. The line of code giving me this error is this: fntOut.DrawText(sDevInfo, _ New Drawing.Rectangle(5, 5, 0, 0), _ DrawTextFormat.Left Or DrawTextFormat.Top, _ Drawing.Color.FromArgb(255, 200, 128, 64)) fntOut declaration is this: Private fntOut As Font When I look at the declaration for the drawtext method of the font object the first parameter is always a sprite. It also says sprite can be null (which is what I want). How do you specify null in VB? I have searched google for examples of this method but have not found a single example that uses the sprite object. Can anyone help
  7. Things like that often catch me out. I had assumed because the class library was part of a windows application it would know about these things but we live and learn.
  8. I want to declare a OpenFileDialog object in a class (the class is in a class library). I try to type system.windows.forms but it is not recognised.
  9. I keep switching between the two options for the connection string, what I am thinking is I could store the actual connection object in a session variable then I can keep the same connection without having to open a new connection on each page. As I understand it, with storing it in a session object the connection will not close until the session ends. This could mean a number of redundant connections could be lying around. Instead of 6 session objects I could have my data in a class and put the class in a session object then the data is persisting.
  10. Is there any safe number of session variables to have. I have 6 and they are small strings, no objects. I was thinking of storing the database connection object in a session variable but then you get into all sorts of checks depending on which page the user happens to start their navigating at.
  11. I can't, When I type the . after web System.Web. intellisence only gives me three options AspNetHostingPermission AspNetHostingPermissionAttribute AspNetHostingPermissionLevel
  12. I have a class that I want to pass a drop down list to as a parameter. The system.web.ui.webcontrols.dropdownlist namespace doesn't seem to exist. How can I declare objects of type Dropdownlist in a class.
  13. Does anyone know what the .NET equivalent is for GetNearestPaletteIndex API
  14. Can anyone transpose this VB6 code I got off another forum to .NET code for me. :D 'module code Option Explicit 'types for palette creation Public Type PALETTEENTRY peRed As Byte peGreen As Byte peBlue As Byte peFlags As Byte End Type Public Type LOGPALETTE palVersion As Integer palNumEntries As Integer palPalEntry(255) As PALETTEENTRY End Type 'Is used to create a logical palette. Public Declare Function CreatePalette Lib "gdi32" (lpLogPalette As LOGPALETTE) As Long 'Will return the palette index of the nearest color to crColor in hPalette. Public Declare Function GetNearestPaletteIndex Lib "gdi32" (ByVal hPalette As Long, ByVal crColor As Long) As Long Public Pal As LOGPALETTE Public hPal As Long 'handle to the palette(will be set = createpalette) 'form code Private Sub Form_Load() Dim x As Long Pal.palNumEntries = 10 Pal.palVersion = &H300 'defines our palette entries and type of palette 'define the colors in the palette Pal.palPalEntry(1).peRed = 1 Pal.palPalEntry(1).peGreen = 2 Pal.palPalEntry(1).peBlue = 3 Pal.palPalEntry(2).peRed = 255 Pal.palPalEntry(2).peGreen = 255 Pal.palPalEntry(2).peBlue = 255 'When you've set the colors in the palette, you now do: hPal = CreatePalette(Pal) x = GetNearestPaletteIndex(hPal, vbRed) 'now to retieve the palette's 'approximate' of somecolor Dim r As Long: r = Pal.palPalEntry(x).peRed Dim g As Long: g = Pal.palPalEntry(x).peGreen Dim b As Long: b = Pal.palPalEntry(x).peBlue MsgBox r & " " & g & " " & b x = GetNearestPaletteIndex(hPal, vbWhite) 'now to retieve the palette's 'approximate' of somecolor r = Pal.palPalEntry(x).peRed g = Pal.palPalEntry(x).peGreen b = Pal.palPalEntry(x).peBlue MsgBox r & " " & g & " " & b End Sub
×
×
  • Create New...