Results 1 to 2 of 2

Thread: 2 small questions ;)

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2004
    Location
    Belgium
    Posts
    77

    Wink 2 small questions ;)

    Hi,

    I just installed VS .NET 2003, and I have two questions.

    1. When I try to create a ASP Web Application I get a error message saying "The web server isn't running ASP 1.1, unable to run application ....". I have Framework 1.1 installed ans ISS too.

    So what should I do ?


    2. (a stupid one ) How can I change the color of a TabControl, I'd liek to make them llok like ine the start page of VS .NET, I putted them in flat apparence, but I donno how I can change their color.


    Thanks for your help

  2. #2
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367
    For #2, you can use this code, adapted from an MSDN example:

    VB Code:
    1. Imports System.Drawing
    2. Imports System.Windows.Forms
    3.  
    4. Public Class Form1
    5.     Inherits Form
    6.     Private tabArea As Rectangle
    7.     Private tabTextArea As RectangleF
    8.  
    9.     Public Sub New()
    10.         Dim tabControl1 As New TabControl
    11.         Dim tabPage1 As New TabPage
    12.  
    13.         ' Allows access to the DrawItem event.
    14.         tabControl1.DrawMode = TabDrawMode.OwnerDrawFixed
    15.  
    16.         tabControl1.SizeMode = TabSizeMode.Fixed
    17.         tabControl1.Controls.Add(tabPage1)
    18.         tabControl1.ItemSize = New Size(80, 30)
    19.         tabControl1.Location = New Point(25, 25)
    20.         tabControl1.Size = New Size(250, 250)
    21.         tabControl1.Appearance = TabAppearance.FlatButtons
    22.         tabPage1.TabIndex = 0
    23.         tabPage1.BackColor = Color.White
    24.         ClientSize = New Size(300, 300)
    25.         Controls.Add(tabControl1)
    26.  
    27.         tabArea = tabControl1.GetTabRect(0)
    28.         tabTextArea = RectangleF.op_Implicit(tabControl1.GetTabRect(0))
    29.  
    30.         ' Binds the event handler DrawOnTab to the DrawItem event
    31.         ' through the DrawItemEventHandler delegate.
    32.         AddHandler tabControl1.DrawItem, AddressOf DrawOnTab
    33.     End Sub
    34.  
    35.     ' Declares the event handler DrawOnTab which is a method that
    36.     ' draws a string and Rectangle on the tabPage1 tab.
    37.     Private Sub DrawOnTab(ByVal sender As Object, ByVal e As DrawItemEventArgs)
    38.         Dim g As Graphics = e.Graphics
    39.         Dim p As New Pen(Color.Blue)
    40.         Dim font As New Font("Arial", 10.0F)
    41.         Dim brush As New SolidBrush(Color.White)
    42.         Dim b As New SolidBrush(Color.Blue)
    43.         Dim tmpText As RectangleF
    44.         g.DrawRectangle(p, tabArea)
    45.         g.FillRectangle(b, tabArea)
    46.         tmpText = tabTextArea
    47.         tmpText.X = tabTextArea.X + 5
    48.         tmpText.Y = tabTextArea.Y + 5
    49.         g.DrawString("Page1", font, brush, tmpText)
    50.     End Sub
    51.  
    52.     Shared Sub Main()
    53.         Application.Run(New Form1)
    54.     End Sub
    55. End Class

    Here is the original:

    http://msdn.microsoft.com/library/de...witemtopic.asp

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width