|
If your form has try ... catch statements then in the catch you can log the exception data which contains the stack of all methods called including the line number where error ocurred.
Look into Exception.Stacktrace to get the list of methods called, and also look at Exception.TargetSite.DeclaringType to get the method name where error ocurred.
|
|
|
|
|
I have a windows form that contains a tab control that contains a single tab page. The autoscroll property is set to True. I'm adding controls, labels in this case. If I set the top property before I add it to the tab page everything works fine. But if I set the top property after adding the label to the tab page and I'm trying to set it to anyting larger than 32676, it simply sets it to 32676 but with no errors. The following is the code I used.
Dim _worksurface As System.Windows.Forms.TabControl
_Worksurface = New System.Windows.Forms.TabControl
_Worksurface.Dock = DockStyle.Fill
_Worksurface.Appearance = TabAppearance.Normal
Dim tp As New System.Windows.Forms.TabPage
tp.AutoScroll = True
tp.Text = "Tab Page"
_Worksurface.TabPages.Add(tp)
Me.Controls.Add(_Worksurface)
Dim l As System.Windows.Forms.Label
Dim OffSet As Integer = 0
For i As Integer = 1 To 10
l = New System.Windows.Forms.Label
l.Text = "Steve-" & i
'l.Top = 32700 + OffSet
tp.Controls.Add(l)
l.Top = 32700 + OffSet
OffSet += 1000
Next
'TRY TO REPOSITION THE LABELS
For Each lab As System.Windows.Forms.Label In tp.Controls
lab.Top = lab.Top + 1
Next
|
|
|
|
|
Your mistake is while using the loop to change the position,
For..Each is ---> READ ONLY LOOP
use For..Next instead
bye
|
|
|
|
|
I get the same results with a FOR NEXT loop. You can actually get the same reults simply by setting the Top property after the control is added to the TabPage where all values greater than 32767 are simply set to 32767.
|
|
|
|
|
Hi everyone:
Im setting up a datagrid control with some special functionality; i mean i need special functionality :
A)
I need to add a new record throw the action of an adding Buttom [This is Done]
B)
After the User Imput Data the only way to save it its throw another save button..
These are the question :
- How can i set the datagrid to be available to edit only one row , in order to edit just the current row i mean if the user navigates to other row the datagrid must back its readonly mode. Just the row been added must allow to modify .
- How does VB.NET cancel and adding Table adding Row Event .. i mean wich its the event that the Table or Datagrid fires when the user tryes to add a new Row . in order to cancel to add a new row until the last user click saves the current row been adde,
Regards
Josue Avila ..
|
|
|
|
|
It is best to specify a datatable such as a datasource. Reason is that you can capture the datatable events when rows are added/modified/deleted.
As far as changing the readonly, I guess you could capture the "CurrentCellChanged" event of the datagrid then you can get the "CurrentRowIndex" property and if it's a different row set the datagrid mode to Readonly.
|
|
|
|
|
Hi,
I'm making an app to get some information from a text file.
The delimiter I have to find the data I want is a "/", but I need to go back from the delimiter until I get one of these caracheters (; , <).
For example, the text line is like this:
<8342342/005.001>
I need the 8342342/005.001 without everything else.
How can I do that?
Thanks in advance.
|
|
|
|
|
Hi!
Why don't you search for something inside <> or ;; and then split with the "/" delimiter?
Never say never
|
|
|
|
|
Hi,
Portuguese or brasilian?
And how can I do that?
Thanks
|
|
|
|
|
Hi!
Eu sou tuga rapaz.
Eu uso uma função parecida com o k tu queres mas não a tenho aqui.
Procuras o caracter de inicio e fim e testas se de facto o caracter k fecha a tag tem um índice superior ao 1º caracter.Depois se kiseres testar se de facto a string tá bem construída procuras um novo caracter de inicio de tag e vês se o índice dele é superior ao índice do caracter de fecho de tag.
inicio = InStr(texto, "<")
fim = InStr(texto, ">")
inicio2 = InStr(inicio + 1, texto, "<")
If inicio < fim AND fim < inicio2 Then
myContents = Mid(texto, inicio + tagSize, fim - (inicio + tagSize))
End If
splittedArray = Split(myContents,"/")
(...)
Meu, escrevi isto de cabeça...mas é +ou- isso, talvéz tenhas de fazer umas alterações para pôr isso mais fiável, mas a base é esta.
Fica bem, irmão.
PS: Os tugas deram banho aos brazucas no futebol de praia nas meias, mas dps na final com a frança...oops palhaços
Never say never
|
|
|
|
|
Boas!
Já tive a ver a tua função e vai de encontro ao que necessito, com umas alterações.
Entretanto, a parte de texto que preciso está tanto entre "<" como entre "," ou ";".
Nesta instrução: inicio = InStr(texto, "<")
Não posso usar um OR algures para dizer que pode iniciar por diferentes caracteres?
Um abraço.
Do futebol de praia só vi o resumo na tv. Mas fizeram o mais díficil e depois falharam o mais fácil.
|
|
|
|
|
Tudo nice?
Explicitamente na instrução não.Tens de procurar individualmente e detectar qual dos caracteres detectaste, o "<", o "," ou o ";".
Para isso talvéz possas usar o método IndexOfAny().Este método retorna o índice da 1ª ocorrência de caracteres presentes num array.Acho k aí podes especificar os caracteres k desejas.Vê como funciona, onde estou n t posso dizer mais sobre este método.
Outra coisa que podias fazer, mas só se esses caracteres apenas forem usados como inicio/fim de tag era fazer um replace e simplificar as tags ficando assim por exemplo só com "," ou ";".Ou seja substituir "<",">" e "," por ";" e assim só tinhas esse caracter pra pesquisar.
Fica bem.
PS:Pensei k eras brazuca por isso é k falei do fute. de praia...era pra t dar tanga, mas como és português n correu bem...
Never say never
|
|
|
|
|
By using below code I will be doing drawing on paint event of picturebox, although it is drawing perfectly but not as free hand drawing.
code:
Enum PathColor
BLUE1 = 0
blue2 = 1
blue3 = 2
blue4 = 3
GREEN1 = 4
green2 = 5
green3 = 6
green4 = 7
RED1 = 8
red2 = 9
red3 = 10
red4 = 11
white1 = 12
black1 = 13
End Enum
Enum pathwidth
blue1w = 0
blue2w = 1
blue3w = 2
blue4w = 3
green1w = 4
green2w = 5
green3w = 6
green4w = 7
red1w = 8
red2w = 9
red3w = 10
red4w = 11
whitew = 12
blackw = 13
'five = 0
'fifteen = 1
End Enum
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
' Create GraphicsPath for each color
'Me.picboard.BackColor = System.Drawing.Color.White
'Me.picboard.ForeColor = System.Drawing.Color.White
Dim pmb As Bitmap = picboard.Image
pmb.MakeTransparent()
'Me.picboard.BackgroundImage = Me.picboard.Image
For i As Integer = 0 To 13
path(i) = New GraphicsPath
'path(i).Reset()
Next i
' Create each color
'Dim myPen As Pen = New Pen(Color.FromArgb(64, Color.Orange), 16)
' myUserColor(PathColor.RED1) = myUserColor(PathColor.RED1).Red.Transparent
myUserColor(PathColor.RED1) = myUserColor(PathColor.RED1).Transparent.Red
myUserColor(PathColor.red2) = myUserColor(PathColor.red2).Transparent.Red
myUserColor(PathColor.red3) = myUserColor(PathColor.red3).Brown
myUserColor(PathColor.red4) = myUserColor(PathColor.red4).Brown
myUserColor(PathColor.BLUE1) = myUserColor(PathColor.BLUE1).Blue
myUserColor(PathColor.blue2) = myUserColor(PathColor.blue2).Blue
myUserColor(PathColor.blue3) = myUserColor(PathColor.blue3).Cyan
myUserColor(PathColor.blue4) = myUserColor(PathColor.blue4).Cyan
myUserColor(PathColor.GREEN1) = myUserColor(PathColor.GREEN1).Green
myUserColor(PathColor.green2) = myUserColor(PathColor.green2).Green
myUserColor(PathColor.green3) = myUserColor(PathColor.green3).Yellow
myUserColor(PathColor.green4) = myUserColor(PathColor.green4).Yellow
myUserColor(PathColor.white1) = myUserColor(PathColor.white1).White
myUserColor(PathColor.black1) = myUserColor(PathColor.black1).Black
myPenWidth(pathwidth.red1w) = 5
myPenWidth(pathwidth.red2w) = 15
myPenWidth(pathwidth.red3w) = 5
myPenWidth(pathwidth.red4w) = 15
myPenWidth(pathwidth.blue1w) = 5
myPenWidth(pathwidth.blue2w) = 15
myPenWidth(pathwidth.blue3w) = 5
myPenWidth(pathwidth.blue4w) = 15
myPenWidth(pathwidth.green1w) = 5
myPenWidth(pathwidth.green2w) = 15
myPenWidth(pathwidth.green3w) = 5
myPenWidth(pathwidth.green4w) = 15
myPenWidth(pathwidth.whitew) = 5
myPenWidth(pathwidth.blackw) = 5
End Sub
Paint event code:
Dim CurrentPen = New Pen(Color.FromArgb(myAlpha, myUserColor(index)), myPenWidth(index))
'Set up the pen
Graphics.FromImage(picboard.Image).DrawPath(CurrentPen, path(index))
Welcome any help!!
|
|
|
|
|
I didn't trawl though your code, but freehand drawing is easy - just catch the mousemove event, and every time, add the mouse position to a path object, and then draw the path in your paint event ( obviously invalidate on mouse move so it draws ). I have a paint program here on CP called 'Doodle'. I think it's in C++, but its in GDI+, so the code should port pretty easily.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
i wants to send fax through vb.net application
i added reference of faxservice'sdll
and usiong the following code:
FaxServerClass fs = new FaxServerClass();
fs.Connect("mymachine"); //specifies the machinename
object obj = fs.CreateDocument("myfilename");
FaxDoc fd = (FaxDoc)obj;
fd.FaxNumber = "myfax#";
fd.RecipientName = "Tester";
int i = fd.Send();
MessageBox.Show(i.ToString());
fs.Disconnect();
i dont have modem
but have lan card which is connected to internet
how can i send fax
|
|
|
|
|
Dont really know much about this but could you give us the error/output that you recieve when you run the code.
Do you have Windows fax services installed and configured on the computer in the connect("mymachine") line?
|
|
|
|
|
yes
installed. is there any way any dll in .net to send fax
i don't wants to use com object
any example ?
|
|
|
|
|
Hello,
I want to Stop my printer after it finished printing. But when printing of a page (even it contains only one line) finished, the printer ejects the page. I want to have control on page-tracking.
Thank you
|
|
|
|
|
I am working on an app that allows me to enter items into a listview control, I also would like to add a image to that particular item how can I do that using the select case function? Or is there another way to do that? Also I want to be able to double click on any item in the listview control and it will display information about the selected item. I have been having trouble selecting item from the ListView control using Select Case.
Can you please let me know what I am doing wrong….
Thanks
Thanks cPod....
|
|
|
|
|
Hi!
1 - Concerning adding items and associating an image to them you could associate an ImageList to the smallImageList or largeImageList property of the class and then when you're creating the items do:
myListView.Items.Add(New ListViewItem("blablabla", myImageIndex))
myImageIndex is the imageList index of the image you whish to show in the item.
2- To show Info about ONE selected item you have to put this code in the doubleClick event of the Listview:
myListView = CType(sender,ListView)
ListViewSelectedText = myListView.SelectedItems(0).Text
With this you're getting the text of the item.You can also have for example some info in the tag property...
ListViewSelectedTag = myListView.SelectedItems(0).Tag
NOTE: If you have the multiselect property active then you'll have to iterate through the selectedItems collection and get the info you need
Never say never
|
|
|
|
|
Is it possible to bind images from a database into a ListView Control?
Thanks
Thanks cPod....
|
|
|
|
|
Hi!
I've never done that but maybe you should check out the bindingContext property.
Sorry i can't give you any more help.
Never say never
|
|
|
|
|
i have a big prob. i'm doing a mail filtering system but have no idea on starting to code it. my system need to get incoming mails then scan the mails to filter spam. one of the function is to limit mail's size. maximum mail size allowed is 10000KB. mails that exceed dis size will be considered spam. anyone knows how to code dis whole thing in VB.NET??
|
|
|
|
|
TIFC wrote:
anyone knows how to code dis whole thing in VB.NET??
Probably, if they expend a considerable amount of time to the problem. Your best solution if you want a reasonable response here is to break the problem down into smaller problems, and then those smaller problems in to even smaller problems still. If you get stuck on a small problem then it will probably be of a size where you can expect a more helpful response from people on this forum.
Most people who respond on this, and any forum, will only respond to things that they can immediately or very quickly answer. Your question requires several hours of effort just to begin to produce a response that would be useful for a question that is so vague.
My: Blog | Photos | Next SQL Presentation
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
i would like to know how to create a multithreaded server which listen to port 25 using vb.net.
urgent, pls help. 10s
|
|
|
|