|
actually i want to do is the label can be display like this:
L
A
B
E
L
1
instead of LABEL1
by the way..thanks alot for your help..
|
|
|
|
|
well I'm sure you can alter the code from those articles.
My first idea would be to make a custom control inherited from label.
Then on the textchanged event set the height of the label (and width)
Then draw the every letter (make an array with the split function) on the control.
Haven't done it myself but it shouldn't be that hard to do.
If I have time I'll see what I can come up with once I'm home
|
|
|
|
|
oke thanks..but i dnt know how to do that.. ,but i will try tonite,,thanks alots,,have a nice day!!!
|
|
|
|
|
Public Class VerticalLabel
Inherits Label
Public Sub New()
Me.AutoSize = False
End Sub
Public Overrides Property AutoSize() As Boolean
Get
Return MyBase.AutoSize
End Get
Set(ByVal value As Boolean)
MyBase.AutoSize = False
End Set
End Property
Protected Overloads Overrides Sub OnPaint(ByVal e As PaintEventArgs)
Dim graphics As Graphics = e.Graphics
Dim text As String = Me.Text
Dim width As Integer = 0
Dim height As Integer = 0
Dim textBrush As Brush = New SolidBrush(Me.ForeColor)
For Each c As Char In text.ToCharArray()
Dim sw As Single = graphics.MeasureString(c, Me.Font).Width
If sw > width Then
width = sw
End If
Dim sh As Single = graphics.MeasureString(c, Me.Font).Height
height += sh
graphics.DrawString(c, Me.Font, textBrush, 0, height - sh)
Next
Me.Width = width
Me.Height = height + 2
End Sub
Private Sub VerticalLabel_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.TextChanged
Me.Refresh()
End Sub
End Class
This should do what you want (very basic so you might want to add a bit, like an option to set it to vertical or horizontal,...)
|
|
|
|
|
oke, how about multiple label???
|
|
|
|
|
????? multiple label?
I gave you a custom control just copy past the code into an empty class file.
Build you solution and you'll have an extra control in you toolbox which you then can drag onto you form as many times as you want
|
|
|
|
|
Just rotate the monitor 90° right.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Actually still wouldn't solve his problem but still funny
|
|
|
|
|
look at this...
Application.Restart()
if i use this,the application will restart..but i dnt want the application to restart?
any idea?..plss..txxx..
|
|
|
|
|
You would need to write a Reset method that manually re initialises all your objects and variables
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Why are you reposting same question[^]?
The word "politics" describes the process so well: "Poli" in Latin meaning "many" and "tics" meaning "bloodsucking creatures."
जय हिंद
|
|
|
|
|
hi ,
i have a question about events in vb.net ,
im looking for a similar functionality to c# event registering ,
like how could i "unregister" an event during run time and then register it back.
for example in c#
myclass.myEvent -= new MyEvent(myHabdler);
[code block , that i dont want the event will fire]
myclass.myEvent += new MyEvent(myHabdler);
thank you for your time!
Net
|
|
|
|
|
Hi,
I suggest you read up on the AddHandler and RemoveHandler methods. They serve that very purpose.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Thank you its exactly what i was looking for.
Net
|
|
|
|
|
hi, i've written a few applications using vb.net, and they all work fine on my computer, but after copying into another computer, there is always one error or the other. sometimes, the applications woulnd't even start up at all. i've seen other applications that people developed using vb.net, i've downloaded some from the internet and they dont seem to have any problems... how do they do it?
how can i make my vb.net applications run on other computers without an error message???
|
|
|
|
|
|
yea, i've tried that. it only solves error at start up. but... how can i distribute the application without a setup? for example, there an application i downloaded, it had just the .exe and some .dll files... no setup or anything, and the application works just fine! i want to be able to distribute ma applications just like that. i wrote a little yahoo multi messenger patch application... the application is too little to create a setup for it. so what can i do?
|
|
|
|
|
There are several aspects to consider in development and deployment. Just think about the following ones at least.
Hardware and software is a broad subject. I have no doubt that evey developer has faced with such problems because development is not as easy as we think. There is no perfect software and even hardware and definetly there is no expert one to solve every type of problem. The problems are time depended to be solved.
We all make mistakes and therefore we draw something from the story we experienced not to fall into it again.
Targeted OS is important (32 bit / 64 Bit)
The frame work is importand (for example you developed an app with .Net frame work 3.0) if the user doesn't have this framework in his/her system, he suppose to download it to make your app running.
Whichever library you use during the devlopment make sure that you have to also include this libraries in deployment package. Some time you use your own ones but sometime you use the ones which belongs to OS.
Consider the security issues and make sure that OS will allow you to install your app.
Surely you will come over the problem soon.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
i search for visual basic code that i can use in a macro to copy tables to excel sheet...
from : http://www.nhl.com/scores/htmlreports/20082009/PL020875.HTM
i want to automate the extraction process in my excel macro to do it several times from similar pages with different datas and do a analysist of the data. i want to keep same format as in the web page
can you please help me?
i can pay for help
please reply!!!!!
modified on Sunday, February 22, 2009 3:53 PM
|
|
|
|
|
There is a computer competition in our school , programming with Visual Basic , but they didn't specified which version of Visual basic is gonna be used , and due to their .... computers , everything is possible , even VB2002(3) ( not sure which version really exits !! )
right now i'm learning C# , but I want to learn some Basic for this competition . If i start learning VB.NET 2008 syntaxes , can i use them in 2005 and 2002(3) versions too ? what is the real difference between them ?
17 years old, new to C# and programming
|
|
|
|
|
For what's new follow the links here:
What's New in Visual Basic[^]
Mohammad Reza Sabouri wrote: If i start learning VB.NET 2008 syntaxes , can i use them in 2005 and 2002(3) versions too ?
No. But you may as well use the latest version. It will be more fun.
Kevin
|
|
|
|
|
Hi
I have formulated a function that checks the titles of the IE pages open and if required page is found, takes the appropriate action (in this code snippet, just tells by message box)
The problem is function does not do the required job.
Where is the bug? Any help would be appriciated.
Thanks (vb.net version 2003)
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim strNames() As String = {"Yahoo", "Gmail", "Hotmail"}
Dim bln As Boolean = FindWindow(strNames)
MsgBox(bln.ToString)
End Sub
Private Function FindWindow(ByVal Names() As String) As Boolean
Dim pr As Process() = Process.GetProcessesByName("iexplore")
If pr.Length > 0 Then
For i As Integer = 0 To UBound(pr)
For j As Integer = 0 To UBound(Names)
If pr(i).MainWindowTitle.IndexOf(Names(j)) <> -1 Then
Return True
Exit Function
End If
Next j
Next i
End If
End Function
reman
|
|
|
|
|
Amer Rehman wrote: The problem is function does not do the required job.
OK, so what does it do?
My guess is that you are finding that Process.GetProcessesByName("iexplore") returns one process. If you look at the process tab of task manager you will see that only one instance of internet explorer runs irrespective of the number of windows it has open. Contrast this to Notepad which starts one instance per window.
The title you are retrieving via pr.MainWindowTitle is the current iexplore window.
By the way I got all of this information from four lines of code and an inquisitive mind. How are your debugging skills today?
Alan.
|
|
|
|
|
Thanks for reply, but I am sorry to say that you are wrong.
First, what do I want? I want to prevent user from downloading other than the mail pages(Yahoo, Gmail,Hotmail).
Process.GetProcessesByName("iexplore") returns an array of processes whose Title we can retrieve in this way pr(i).GetMainWindowTitle. If we change the argument "i" we can retrieve all the open windows of IE though the process type is one ("iexplore").
What does the application do?
It gives wrong answers.i.e. if the mail page is open first, it says "True", but if it is opened after opening another IE page, it says "False" despite the fact that it is open.
reman
|
|
|
|
|
I'm running IE6 and this has one process for all windows. What version are you running?
Alan.
|
|
|
|